Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Core/LibraryManager.cs
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Core/LibraryManager.cs
r2768 r4068 1 using System;2 using System.Collections.Generic;3 using System.Text;4 using System.Diagnostics;5 1 6 namespace Netron.Diagramming.Core 7 { 8 // ---------------------------------------------------------------------- 2 namespace Netron.Diagramming.Core { 3 // ---------------------------------------------------------------------- 4 /// <summary> 5 /// Manages the collection of libraries. 6 /// </summary> 7 // ---------------------------------------------------------------------- 8 public class LibraryManager { 9 // ------------------------------------------------------------------ 9 10 /// <summary> 10 /// Manages the collection of libraries.11 /// The collection of shapes for this library. 11 12 /// </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; 13 // ------------------------------------------------------------------ 14 private CollectionBase<Library> myLibraries; 21 15 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 } 16 // ------------------------------------------------------------------ 17 /// <summary> 18 /// Gets the collection of all libraries. 19 /// </summary> 20 // ------------------------------------------------------------------ 21 public CollectionBase<Library> Libraries { 22 get { 23 return myLibraries; 24 } 25 } 26 27 // ------------------------------------------------------------------ 28 /// <summary> 29 /// Constructor. 30 /// </summary> 31 // ------------------------------------------------------------------ 32 public LibraryManager() { 33 myLibraries = new CollectionBase<Library>(); 34 } 35 36 // ------------------------------------------------------------------ 37 /// <summary> 38 /// Creates a new instance of the shape that has the GUID specified. 39 /// </summary> 40 /// <param name="guid">string</param> 41 /// <returns>IShape</returns> 42 // ------------------------------------------------------------------ 43 public IShape CreateNewInstance(string guid) { 44 foreach (Library lib in myLibraries) { 45 if (lib.ContainsShape(guid)) { 46 return lib.CreateNewInstance(guid); 33 47 } 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 } 48 } 49 return null; 63 50 } 51 } 64 52 }
Note: See TracChangeset
for help on using the changeset viewer.