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