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/Connection.Serialization.cs @ 2768

Last change on this file since 2768 was 2768, checked in by mkommend, 14 years ago

added solution folders and sources for the netron library (ticket #867)

File size: 5.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4using System.Drawing;
5using System.ComponentModel;
6using System.Runtime.Serialization;
7using System.Xml.Serialization;
8using System.Diagnostics;
9using System.Xml.Schema;
10namespace Netron.Diagramming.Core
11{
12    /// <summary>
13    /// Complementary partial class related to (de)serialization.
14    /// </summary>
15   [Serializable]
16    public  partial class Connection : ISerializable, IXmlSerializable, IDeserializationCallback 
17    {
18        #region Deserialization constructor
19        /// <summary>
20        /// Deserialization constructor
21        /// </summary>
22        /// <param name="info">The info.</param>
23        /// <param name="context">The context.</param>
24        protected Connection(SerializationInfo info, StreamingContext context) : base(info, context)
25        {
26            if(Tracing.BinaryDeserializationSwitch.Enabled)
27                Trace.WriteLine("Deserializing the fields of 'Connection'.");
28
29            double version = info.GetDouble("ConnectionVersion");
30        }
31        #endregion
32
33        #region Serialization events
34       /*
35        [OnSerializing]
36        void OnSerializing(StreamingContext context)
37        {
38            Trace.WriteLine("Starting to serializing the 'Connection' class...");
39        }
40        [OnSerialized]
41        void OnSerialized(StreamingContext context)
42        {           
43            Trace.WriteLine("...serialization of 'Connection' 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 'Connection' class...");
55        }
56        [OnDeserialized]
57        void OnDeserialized(StreamingContext context)
58         {
59             Trace.WriteLine("...deserialization of 'Connection' 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 override void GetObjectData(SerializationInfo info, StreamingContext context)
73        {
74            if(Tracing.BinarySerializationSwitch.Enabled)
75                Trace.WriteLine("Serializing the fields of 'Connection'.");
76            base.GetObjectData(info, context);
77            info.AddValue("ConnectionVersion", connectionVersion);
78        }
79        #endregion
80
81        #region Xml serialization
82        /// <summary>
83        /// This property is reserved, apply the <see cref="T:System.Xml.Serialization.XmlSchemaProviderAttribute"></see> to the class instead.
84        /// </summary>
85        /// <returns>
86        /// 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.
87        /// </returns>
88        public override XmlSchema GetSchema()
89        {
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        {
99            throw new NotImplementedException("The method or operation is not implemented.");
100        }
101
102        /// <summary>
103        /// Converts an object into its XML representation.
104        /// </summary>
105        /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"></see> stream to which the object is serialized.</param>
106        public override void WriteXml(System.Xml.XmlWriter writer)
107        {
108            throw new NotImplementedException("The method or operation is not implemented.");
109        }
110        #endregion
111
112        #region IDeserializationCallback Members
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 override void OnDeserialization(object sender)
119        {
120            base.OnDeserialization(sender);
121            if(Tracing.BinaryDeserializationSwitch.Enabled)
122                Trace.WriteLine("IDeserializationCallback of 'Connection' called.");
123        }
124
125        #endregion
126    }
127}
Note: See TracBrowser for help on using the repository browser.