Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Serialization/ComplexRectangle.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/ComplexRectangle.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 namespace Netron.Diagramming.Core 11 { 6 namespace 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 12 13 /// <summary> 13 /// Complementary partial class related to (de)serialization.14 /// Deserialization constructor 14 15 /// </summary> 15 [Serializable] 16 public partial class ComplexRectangle : 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 ComplexRectangle(SerializationInfo info, StreamingContext context) 25 : base(info, context) 26 { 27 if(Tracing.BinaryDeserializationSwitch.Enabled) 28 Trace.WriteLine("Deserializing the fields of 'ComplexRectangle'."); 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'."); 29 22 30 31 32 23 double version = info.GetDouble("ComplexRectangleVersion"); 24 } 25 #endregion 33 26 34 35 27 #region Serialization events 28 /* 36 29 [OnSerializing] 37 30 void OnSerializing(StreamingContext context) … … 47 40 } 48 41 */ 49 42 #endregion 50 43 51 52 44 #region Deserialization events 45 /* 53 46 [OnDeserializing] 54 47 void OnDeserializing(StreamingContext context) … … 58 51 } 59 52 */ 60 [OnDeserialized] 61 void OnDeserialized(StreamingContext context) 62 { 63 Trace.WriteLine("...deserialization of 'ComplexRectangle' finished"); 53 [OnDeserialized] 54 void OnDeserialized(StreamingContext context) { 55 Trace.WriteLine("...deserialization of 'ComplexRectangle' finished"); 64 56 65 foreach(IShapeMaterial material in Children) 66 { 67 if(typeof(FolderMaterial).IsInstanceOfType(material)) 68 (material as FolderMaterial).OnFolderChanged += new EventHandler<RectangleEventArgs>(folder_OnFolderChanged); 69 } 57 foreach (IShapeMaterial material in Children) { 58 if (typeof(FolderMaterial).IsInstanceOfType(material)) 59 (material as FolderMaterial).OnFolderChanged += new EventHandler<RectangleEventArgs>(folder_OnFolderChanged); 60 } 70 61 71 } 72 73 #endregion 62 } 74 63 75 #region Serialization 76 /// <summary> 77 /// Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> with the data needed to serialize the target object. 78 /// </summary> 79 /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"></see> to populate with data.</param> 80 /// <param name="context">The destination (see <see cref="T:System.Runtime.Serialization.StreamingContext"></see>) for this serialization.</param> 81 /// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission. </exception> 82 public override void GetObjectData(SerializationInfo info, StreamingContext context) 83 { 84 if(Tracing.BinarySerializationSwitch.Enabled) 85 Trace.WriteLine("Serializing the fields of 'ComplexRectangle'."); 86 base.GetObjectData(info, context); 64 #endregion 87 65 88 info.AddValue("ComplexRectangleVersion", complexRectangleVersion); 89 } 90 #endregion 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); 91 77 92 #region Xml serialization 93 /// <summary> 94 /// This property is reserved, apply the <see cref="T:System.Xml.Serialization.XmlSchemaProviderAttribute"></see> to the class instead. 95 /// </summary> 96 /// <returns> 97 /// 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. 98 /// </returns> 99 public override XmlSchema GetSchema() 100 { 101 throw new NotImplementedException("The method or operation is not implemented."); 102 } 78 info.AddValue("ComplexRectangleVersion", complexRectangleVersion); 79 } 80 #endregion 103 81 104 /// <summary> 105 /// Generates an object from its XML representation. 106 /// </summary> 107 /// <param name="reader">The <see cref="T:System.Xml.XmlReader"></see> stream from which the object is deserialized.</param> 108 public override void ReadXml(System.Xml.XmlReader reader) 109 { 110 throw new NotImplementedException("The method or operation is not implemented."); 111 } 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 } 112 92 113 /// <summary> 114 /// Converts an object into its XML representation. 115 /// </summary> 116 /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"></see> stream to which the object is serialized.</param> 117 public override void WriteXml(System.Xml.XmlWriter writer) 118 { 119 throw new NotImplementedException("The method or operation is not implemented."); 120 } 121 #endregion 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 122 109 123 110 124 111 125 /// <summary> 126 /// Runs when the entire object graph has been deserialized. 127 /// </summary> 128 /// <param name="sender">The object that initiated the callback. The functionality for this parameter is not currently implemented.</param> 129 public override void OnDeserialization(object sender) 130 { 131 base.OnDeserialization(sender); 132 if(Tracing.BinaryDeserializationSwitch.Enabled) 133 Trace.WriteLine("IDeserializationCallback of 'ComplexRectangle' called."); 134 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."); 135 120 136 } 121 137 122 } 123 } 138 124 }
Note: See TracChangeset
for help on using the changeset viewer.