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