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/Serialization/Anchors.cs @ 4068

Last change on this file since 4068 was 4068, checked in by swagner, 14 years ago

Sorted usings and removed unused usings in entire solution (#1094)

File size: 1.5 KB
Line 
1using System;
2using System.Collections.Generic;
3
4namespace Netron.Diagramming.Core {
5  public struct Anchor {
6
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    }
18
19
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    }
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;
40    }
41    #endregion
42
43
44  }
45  public static class Anchors {
46    private static Dictionary<Guid, Anchor> innerList = new Dictionary<Guid, Anchor>();
47
48    public static void Clear() {
49      innerList.Clear();
50    }
51
52    public static void Add(Guid uid, Anchor anchor) {
53      innerList.Add(uid, anchor);
54    }
55
56    public static bool ContainsKey(Guid uid) {
57      return innerList.ContainsKey(uid);
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  }
68}
Note: See TracBrowser for help on using the repository browser.