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