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/TextOnly.Serialization.cs @ 15973

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

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

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