using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
namespace Netron.Diagramming.Core
{
// ----------------------------------------------------------------------
///
/// Manages the collection of libraries.
///
// ----------------------------------------------------------------------
public class LibraryManager
{
// ------------------------------------------------------------------
///
/// The collection of shapes for this library.
///
// ------------------------------------------------------------------
private CollectionBase myLibraries;
// ------------------------------------------------------------------
///
/// Gets the collection of all libraries.
///
// ------------------------------------------------------------------
public CollectionBase Libraries
{
get
{
return myLibraries;
}
}
// ------------------------------------------------------------------
///
/// Constructor.
///
// ------------------------------------------------------------------
public LibraryManager()
{
myLibraries = new CollectionBase();
}
// ------------------------------------------------------------------
///
/// Creates a new instance of the shape that has the GUID specified.
///
/// string
/// IShape
// ------------------------------------------------------------------
public IShape CreateNewInstance(string guid)
{
foreach (Library lib in myLibraries)
{
if (lib.ContainsShape(guid))
{
return lib.CreateNewInstance(guid);
}
}
return null;
}
}
}