Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Serialization/Anchors.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/Serialization/Anchors.cs
r2768 r4068 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.Text;4 3 5 namespace Netron.Diagramming.Core 6 { 7 public struct Anchor 8 { 9 10 /// <summary> 11 /// the Parent field 12 /// </summary> 13 private Guid mParent; 14 /// <summary> 15 /// Gets or sets the Parent 16 /// </summary> 17 public Guid Parent 18 { 19 get { return mParent;} 20 set { mParent = value;} 21 } 4 namespace Netron.Diagramming.Core { 5 public struct Anchor { 22 6 23 24 /// <summary> 25 /// the Instance field 26 /// </summary> 27 private IConnector mInstance; 28 /// <summary> 29 /// Gets or sets the Instance 30 /// </summary> 31 public IConnector Instance 32 { 33 get { return mInstance;} 34 set { mInstance = value;} 35 } 7 /// <summary> 8 /// the Parent field 9 /// </summary> 10 private Guid mParent; 11 /// <summary> 12 /// Gets or sets the Parent 13 /// </summary> 14 public Guid Parent { 15 get { return mParent; } 16 set { mParent = value; } 17 } 36 18 37 19 38 #region Constructor39 ///<summary>40 ///Default constructor41 ///</summary>42 public Anchor(Guid parent, IConnector instance)43 {44 this.mParent = parent;45 this.mInstance = instance;46 47 #endregion48 20 /// <summary> 21 /// the Instance field 22 /// </summary> 23 private IConnector mInstance; 24 /// <summary> 25 /// Gets or sets the Instance 26 /// </summary> 27 public IConnector Instance { 28 get { return mInstance; } 29 set { mInstance = value; } 30 } 49 31 32 33 #region Constructor 34 ///<summary> 35 ///Default constructor 36 ///</summary> 37 public Anchor(Guid parent, IConnector instance) { 38 this.mParent = parent; 39 this.mInstance = instance; 50 40 } 51 public static class Anchors 52 { 53 private static Dictionary<Guid, Anchor> innerList = new Dictionary<Guid, Anchor>(); 41 #endregion 54 42 55 public static void Clear()56 {57 innerList.Clear();58 }59 43 60 public static void Add(Guid uid, Anchor anchor) 61 { 62 innerList.Add(uid, anchor); 63 } 44 } 45 public static class Anchors { 46 private static Dictionary<Guid, Anchor> innerList = new Dictionary<Guid, Anchor>(); 64 47 65 public static bool ContainsKey(Guid uid) 66 { 67 return innerList.ContainsKey(uid); 68 } 48 public static void Clear() { 49 innerList.Clear(); 50 } 69 51 70 public static Dictionary<Guid, Anchor>.Enumerator GetEnumerator() 71 { 72 return innerList.GetEnumerator(); 73 } 52 public static void Add(Guid uid, Anchor anchor) { 53 innerList.Add(uid, anchor); 54 } 74 55 75 public static Anchor GetAnchor(Guid uid) 76 { 77 return innerList[uid]; 78 } 56 public static bool ContainsKey(Guid uid) { 57 return innerList.ContainsKey(uid); 79 58 } 59 60 public static Dictionary<Guid, Anchor>.Enumerator GetEnumerator() { 61 return innerList.GetEnumerator(); 62 } 63 64 public static Anchor GetAnchor(Guid uid) { 65 return innerList[uid]; 66 } 67 } 80 68 }
Note: See TracChangeset
for help on using the changeset viewer.