1 |
|
---|
2 | using System;
|
---|
3 | using System.Xml;
|
---|
4 | using System.Xml.Serialization;
|
---|
5 | using System.IO;
|
---|
6 |
|
---|
7 |
|
---|
8 | namespace Netron.GraphLib.IO.NML
|
---|
9 | {
|
---|
10 | /// <summary>
|
---|
11 | /// XML wrapper for a shape object
|
---|
12 | /// </summary>
|
---|
13 | [XmlType(IncludeInSchema=true, TypeName="node.type")]
|
---|
14 | [XmlRoot(ElementName="Shape", IsNullable=false, DataType="")]
|
---|
15 | public class ShapeType
|
---|
16 | {
|
---|
17 | #region Fields
|
---|
18 | /// <summary>
|
---|
19 | /// data collection
|
---|
20 | /// </summary>
|
---|
21 | private DataCollection mData = new DataCollection();
|
---|
22 | /// <summary>
|
---|
23 | /// the description
|
---|
24 | /// </summary>
|
---|
25 | private string mDescription;
|
---|
26 | /// <summary>
|
---|
27 | /// the mUID
|
---|
28 | /// </summary>
|
---|
29 | private string mUID;
|
---|
30 | /// <summary>
|
---|
31 | /// the unique key to the shape to be instantiated
|
---|
32 | /// </summary>
|
---|
33 | private string mInstanceKey = string.Empty;
|
---|
34 | #endregion
|
---|
35 |
|
---|
36 | #region Properties
|
---|
37 | /// <summary>
|
---|
38 | /// Gets or sets the key to use when instantiating/deserializing the node again
|
---|
39 | /// </summary>
|
---|
40 | [XmlElement(ElementName="InstanceKey")]
|
---|
41 | public string InstanceKey
|
---|
42 | {
|
---|
43 | get{return mInstanceKey;}
|
---|
44 | set{mInstanceKey = value;}
|
---|
45 | }
|
---|
46 | /// <summary>
|
---|
47 | /// Gets or sets the description
|
---|
48 | /// </summary>
|
---|
49 | [XmlElement(ElementName="desc")]
|
---|
50 | public virtual string Desc
|
---|
51 | {
|
---|
52 | get
|
---|
53 | {
|
---|
54 | return this.mDescription;
|
---|
55 | }
|
---|
56 | set
|
---|
57 | {
|
---|
58 | this.mDescription = value;
|
---|
59 | }
|
---|
60 | }
|
---|
61 |
|
---|
62 | /// <summary>
|
---|
63 | /// Gets or sets the data collection
|
---|
64 | /// </summary>
|
---|
65 | [XmlElement(ElementName="locator", Type=typeof(LocatorType))]
|
---|
66 | [XmlElement(ElementName="graph", Type=typeof(GraphType))]
|
---|
67 | [XmlElement(ElementName="property", Type=typeof(DataType))]
|
---|
68 | [XmlElement(ElementName="port", Type=typeof(PortType))]
|
---|
69 | [XmlElement(ElementName="connector", Type=typeof(ConnectorType))]
|
---|
70 | public virtual DataCollection Data
|
---|
71 | {
|
---|
72 | get
|
---|
73 | {
|
---|
74 | return this.mData;
|
---|
75 | }
|
---|
76 | set
|
---|
77 | {
|
---|
78 | this.mData = value;
|
---|
79 | }
|
---|
80 | }
|
---|
81 | /// <summary>
|
---|
82 | /// Gets or sets the mUID
|
---|
83 | /// </summary>
|
---|
84 | [XmlElement(ElementName="UID")]
|
---|
85 | public virtual string UID
|
---|
86 | {
|
---|
87 | get
|
---|
88 | {
|
---|
89 | return this.mUID;
|
---|
90 | }
|
---|
91 | set
|
---|
92 | {
|
---|
93 | this.mUID = value;
|
---|
94 | }
|
---|
95 | }
|
---|
96 | #endregion
|
---|
97 | }
|
---|
98 | }
|
---|
99 |
|
---|