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/ComplexRectangle.Serialization.cs @ 13400

Last change on this file since 13400 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.Runtime.Serialization;
4using System.Xml.Schema;
5using System.Xml.Serialization;
6namespace Netron.Diagramming.Core {
7  /// <summary>
8  /// Complementary partial class related to (de)serialization.
9  /// </summary>
10  [Serializable]
11  public partial class ComplexRectangle : 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 ComplexRectangle(SerializationInfo info, StreamingContext context)
19      : base(info, context) {
20      if (Tracing.BinaryDeserializationSwitch.Enabled)
21        Trace.WriteLine("Deserializing the fields of 'ComplexRectangle'.");
22
23      double version = info.GetDouble("ComplexRectangleVersion");
24    }
25    #endregion
26
27    #region Serialization events
28    /*
29        [OnSerializing]
30        void OnSerializing(StreamingContext context)
31        {
32            Trace.Indent();
33            Trace.WriteLine("Starting to serializing the 'ComplexRectangle' class...");
34        }
35        [OnSerialized]
36        void OnSerialized(StreamingContext context)
37        {
38            Trace.WriteLine("...serialization of 'ComplexRectangle' finished");
39            Trace.Unindent();
40        }
41        */
42    #endregion
43
44    #region Deserialization events
45    /*
46        [OnDeserializing]     
47        void OnDeserializing(StreamingContext context)
48        {
49            Trace.Indent();
50            Trace.WriteLine("IDeserializationCallback of 'ComplexRectangle' called.");
51        }
52        */
53    [OnDeserialized]
54    void OnDeserialized(StreamingContext context) {
55      Trace.WriteLine("...deserialization of 'ComplexRectangle' finished");
56
57      foreach (IShapeMaterial material in Children) {
58        if (typeof(FolderMaterial).IsInstanceOfType(material))
59          (material as FolderMaterial).OnFolderChanged += new EventHandler<RectangleEventArgs>(folder_OnFolderChanged);
60      }
61
62    }
63
64    #endregion
65
66    #region Serialization
67    /// <summary>
68    /// Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> with the data needed to serialize the target object.
69    /// </summary>
70    /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> to populate with data.</param>
71    /// <param name="context">The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext"></see>) for this serialization.</param>
72    /// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception>
73    public override void GetObjectData(SerializationInfo info, StreamingContext context) {
74      if (Tracing.BinarySerializationSwitch.Enabled)
75        Trace.WriteLine("Serializing the fields of 'ComplexRectangle'.");
76      base.GetObjectData(info, context);
77
78      info.AddValue("ComplexRectangleVersion", complexRectangleVersion);
79    }
80    #endregion
81
82    #region Xml serialization
83    /// <summary>
84    /// This property is reserved, apply the <see cref="T:System.Xml.Serialization.XmlSchemaProviderAttribute"></see> to the class instead.
85    /// </summary>
86    /// <returns>
87    /// 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.
88    /// </returns>
89    public override XmlSchema GetSchema() {
90      throw new NotImplementedException("The method or operation is not implemented.");
91    }
92
93    /// <summary>
94    /// Generates an object from its XML representation.
95    /// </summary>
96    /// <param name="reader">The <see cref="T:System.Xml.XmlReader"></see> stream from which the object is deserialized.</param>
97    public override void ReadXml(System.Xml.XmlReader reader) {
98      throw new NotImplementedException("The method or operation is not implemented.");
99    }
100
101    /// <summary>
102    /// Converts an object into its XML representation.
103    /// </summary>
104    /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"></see> stream to which the object is serialized.</param>
105    public override void WriteXml(System.Xml.XmlWriter writer) {
106      throw new NotImplementedException("The method or operation is not implemented.");
107    }
108    #endregion
109
110
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 override void OnDeserialization(object sender) {
117      base.OnDeserialization(sender);
118      if (Tracing.BinaryDeserializationSwitch.Enabled)
119        Trace.WriteLine("IDeserializationCallback of 'ComplexRectangle' called.");
120
121
122    }
123  }
124}
Note: See TracBrowser for help on using the repository browser.