Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 |
|
---|
4 | namespace 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.