1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Text;
|
---|
4 | using System.Drawing;
|
---|
5 | using System.ComponentModel;
|
---|
6 | using System.Runtime.Serialization;
|
---|
7 | using System.Xml.Serialization;
|
---|
8 | using System.Diagnostics;
|
---|
9 | using System.Xml.Schema;
|
---|
10 | namespace Netron.Diagramming.Core
|
---|
11 | {
|
---|
12 | /// <summary>
|
---|
13 | /// Complementary partial class related to (de)serialization.
|
---|
14 | /// </summary>
|
---|
15 | [Serializable]
|
---|
16 | public partial class LabelMaterial : ISerializable, IXmlSerializable, IDeserializationCallback
|
---|
17 | {
|
---|
18 | #region Deserialization constructor
|
---|
19 | /// <summary>
|
---|
20 | /// Deserialization constructor
|
---|
21 | /// </summary>
|
---|
22 | /// <param name="info">The info.</param>
|
---|
23 | /// <param name="context">The context.</param>
|
---|
24 | protected LabelMaterial(SerializationInfo info, StreamingContext context)
|
---|
25 | : base(info, context)
|
---|
26 | {
|
---|
27 | if(Tracing.BinaryDeserializationSwitch.Enabled)
|
---|
28 | Trace.WriteLine("Deserializing the fields of 'LabelMaterial'.");
|
---|
29 |
|
---|
30 | double version = info.GetDouble("LabelMaterialVersion");
|
---|
31 |
|
---|
32 | mText = info.GetString("Text");
|
---|
33 | }
|
---|
34 | #endregion
|
---|
35 |
|
---|
36 | #region Serialization events
|
---|
37 | /*
|
---|
38 | [OnSerializing]
|
---|
39 | void OnSerializing(StreamingContext context)
|
---|
40 | {
|
---|
41 | Trace.Indent();
|
---|
42 | Trace.WriteLine("Starting to serializing the 'LabelMaterial' class...");
|
---|
43 | }
|
---|
44 | [OnSerialized]
|
---|
45 | void OnSerialized(StreamingContext context)
|
---|
46 | {
|
---|
47 | Trace.WriteLine("...serialization of 'LabelMaterial' finished");
|
---|
48 | Trace.Unindent();
|
---|
49 | }
|
---|
50 | */
|
---|
51 | #endregion
|
---|
52 |
|
---|
53 | #region Deserialization events
|
---|
54 | /*
|
---|
55 | [OnDeserializing]
|
---|
56 | void OnDeserializing(StreamingContext context)
|
---|
57 | {
|
---|
58 | Trace.Indent();
|
---|
59 | Trace.WriteLine("IDeserializationCallback of 'LabelMaterial' called.");
|
---|
60 | }
|
---|
61 | [OnDeserialized]
|
---|
62 | void OnDeserialized(StreamingContext context)
|
---|
63 | {
|
---|
64 | Trace.WriteLine("...deserialization of 'LabelMaterial' finished");
|
---|
65 | Trace.Unindent();
|
---|
66 | }
|
---|
67 | */
|
---|
68 | #endregion
|
---|
69 |
|
---|
70 | #region Serialization
|
---|
71 | public override void GetObjectData(SerializationInfo info, StreamingContext context)
|
---|
72 | {
|
---|
73 | if(Tracing.BinarySerializationSwitch.Enabled)
|
---|
74 | Trace.WriteLine("Serializing the fields of 'LabelMaterial'.");
|
---|
75 | base.GetObjectData(info, context);
|
---|
76 |
|
---|
77 | info.AddValue("LabelMaterialVersion", labelMaterialVersion);
|
---|
78 | info.AddValue("Text", mText);
|
---|
79 | }
|
---|
80 | #endregion
|
---|
81 |
|
---|
82 | #region Xml serialization
|
---|
83 | /// <summary>
|
---|
84 | /// This property is reserved, apply the <see cref="T:System.Xml.Serialization.XmlSchemaProviderAttribute"></see> to the class instead.
|
---|
85 | /// </summary>
|
---|
86 | /// <returns>
|
---|
87 | /// An <see cref="T:System.Xml.Schema.XmlSchema"></see> that describes the XML representation of the object that is produced by the <see cref="M:System.Xml.Serialization.IXmlSerializable.WriteXml(System.Xml.XmlWriter)"></see> method and consumed by the <see cref="M:System.Xml.Serialization.IXmlSerializable.ReadXml(System.Xml.XmlReader)"></see> method.
|
---|
88 | /// </returns>
|
---|
89 | public override XmlSchema GetSchema()
|
---|
90 | {
|
---|
91 | throw new NotImplementedException("The method or operation is not implemented.");
|
---|
92 | }
|
---|
93 |
|
---|
94 | /// <summary>
|
---|
95 | /// Generates an object from its XML representation.
|
---|
96 | /// </summary>
|
---|
97 | /// <param name="reader">The <see cref="T:System.Xml.XmlReader"></see> stream from which the object is deserialized.</param>
|
---|
98 | public override void ReadXml(System.Xml.XmlReader reader)
|
---|
99 | {
|
---|
100 | throw new NotImplementedException("The method or operation is not implemented.");
|
---|
101 | }
|
---|
102 |
|
---|
103 | /// <summary>
|
---|
104 | /// Converts an object into its XML representation.
|
---|
105 | /// </summary>
|
---|
106 | /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"></see> stream to which the object is serialized.</param>
|
---|
107 | public override void WriteXml(System.Xml.XmlWriter writer)
|
---|
108 | {
|
---|
109 | throw new NotImplementedException("The method or operation is not implemented.");
|
---|
110 | }
|
---|
111 | #endregion
|
---|
112 |
|
---|
113 |
|
---|
114 |
|
---|
115 | /// <summary>
|
---|
116 | /// Runs when the entire object graph has been deserialized.
|
---|
117 | /// </summary>
|
---|
118 | /// <param name="sender">The object that initiated the callback. The functionality for this parameter is not currently implemented.</param>
|
---|
119 | public override void OnDeserialization(object sender)
|
---|
120 | {
|
---|
121 | base.OnDeserialization(sender);
|
---|
122 | if(Tracing.BinaryDeserializationSwitch.Enabled)
|
---|
123 | Trace.WriteLine("IDeserializationCallback of 'LabelMaterial' called.");
|
---|
124 |
|
---|
125 |
|
---|
126 | }
|
---|
127 | }
|
---|
128 | }
|
---|