Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Core/LibraryManager.cs @ 2768

Last change on this file since 2768 was 2768, checked in by mkommend, 14 years ago

added solution folders and sources for the netron library (ticket #867)

File size: 2.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Diagnostics;
5
6namespace Netron.Diagramming.Core
7{
8    // ----------------------------------------------------------------------
9    /// <summary>
10    /// Manages the collection of libraries.
11    /// </summary>
12    // ----------------------------------------------------------------------
13    public class LibraryManager
14    {
15        // ------------------------------------------------------------------
16        /// <summary>
17        /// The collection of shapes for this library.
18        /// </summary>
19        // ------------------------------------------------------------------
20        private CollectionBase<Library> myLibraries;
21
22        // ------------------------------------------------------------------
23        /// <summary>
24        /// Gets the collection of all libraries.
25        /// </summary>
26        // ------------------------------------------------------------------
27        public CollectionBase<Library> Libraries
28        {
29            get
30            {
31                return myLibraries;
32            }
33        }
34
35        // ------------------------------------------------------------------
36        /// <summary>
37        /// Constructor.
38        /// </summary>
39        // ------------------------------------------------------------------
40        public LibraryManager()
41        {
42            myLibraries = new CollectionBase<Library>();           
43        }
44
45        // ------------------------------------------------------------------
46        /// <summary>
47        /// Creates a new instance of the shape that has the GUID specified.
48        /// </summary>
49        /// <param name="guid">string</param>
50        /// <returns>IShape</returns>
51        // ------------------------------------------------------------------
52        public IShape CreateNewInstance(string guid)
53        {
54            foreach (Library lib in myLibraries)
55            {
56                if (lib.ContainsShape(guid))
57                {
58                    return lib.CreateNewInstance(guid);
59                }
60            }
61            return null;
62        }
63    }
64}
Note: See TracBrowser for help on using the repository browser.