Line | |
---|
1 | using System;
|
---|
2 | using System.Xml;
|
---|
3 | using System.Xml.Serialization;
|
---|
4 | using System.IO;
|
---|
5 | namespace Netron.GraphLib.IO.NML {
|
---|
6 |
|
---|
7 | /// <summary>
|
---|
8 | /// The base-template class for the NML serialization,
|
---|
9 | /// this class corresponds to the root of the XML
|
---|
10 | /// </summary>
|
---|
11 | [XmlRoot(ElementName="NML", IsNullable=false, DataType="")]
|
---|
12 | public class NMLType {
|
---|
13 |
|
---|
14 | #region Fields
|
---|
15 |
|
---|
16 | /// <summary>
|
---|
17 | /// the keys
|
---|
18 | /// </summary>
|
---|
19 | private DataCollection mKeys = new DataCollection();
|
---|
20 | /// <summary>
|
---|
21 | /// the graph node
|
---|
22 | /// </summary>
|
---|
23 | private GraphType mGraph;
|
---|
24 | /// <summary>
|
---|
25 | /// the graphlib version
|
---|
26 | /// </summary>
|
---|
27 | private string mVersion;
|
---|
28 | /// <summary>
|
---|
29 | /// the data items
|
---|
30 | /// </summary>
|
---|
31 | private DataCollection mItems = new DataCollection();
|
---|
32 | #endregion
|
---|
33 |
|
---|
34 | #region Properties
|
---|
35 | /// <summary>
|
---|
36 | /// Gets or sets the NML version
|
---|
37 | /// </summary>
|
---|
38 | [XmlElement("Version",typeof(string))]
|
---|
39 | public string Version
|
---|
40 | {
|
---|
41 | get{return mVersion;}
|
---|
42 | set{mVersion = value;}
|
---|
43 | }
|
---|
44 | /// <summary>
|
---|
45 | /// Gets or sets the serialized graph
|
---|
46 | /// </summary>
|
---|
47 | [XmlElement("Graph",typeof(GraphType))]
|
---|
48 | public GraphType Graph
|
---|
49 | {
|
---|
50 | get{return mGraph;}
|
---|
51 | set{mGraph = value;}
|
---|
52 | }
|
---|
53 |
|
---|
54 | /// <summary>
|
---|
55 | /// Gets or sets the key-collection
|
---|
56 | /// </summary>
|
---|
57 | [XmlElement(ElementName="key", Type=typeof(KeyType))]
|
---|
58 | public virtual DataCollection Key {
|
---|
59 | get {
|
---|
60 | return this.mKeys;
|
---|
61 | }
|
---|
62 | set {
|
---|
63 | this.mKeys = value;
|
---|
64 | }
|
---|
65 | }
|
---|
66 |
|
---|
67 |
|
---|
68 | /// <summary>
|
---|
69 | /// Gets or sets the data collection for the graph
|
---|
70 | /// </summary>
|
---|
71 | [XmlElement(ElementName="data", Type=typeof(DataType))]
|
---|
72 | public virtual DataCollection Items {
|
---|
73 | get {
|
---|
74 | return this.mItems;
|
---|
75 | }
|
---|
76 | set {
|
---|
77 | this.mItems = value;
|
---|
78 | }
|
---|
79 | }
|
---|
80 | #endregion
|
---|
81 |
|
---|
82 |
|
---|
83 |
|
---|
84 |
|
---|
85 | }
|
---|
86 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.