Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Serialization/GradientPaintStyle.Serialization.cs @ 4068

Last change on this file since 4068 was 4068, checked in by swagner, 14 years ago

Sorted usings and removed unused usings in entire solution (#1094)

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