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