Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Serialization/LinePenStyle.Serialization.cs

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

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

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