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