Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Serialization/LinePenStyle.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/LinePenStyle.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; 3 using System.Drawing.Drawing2D; 6 4 using System.Runtime.Serialization; 5 using System.Xml.Schema; 7 6 using System.Xml.Serialization; 8 using System.Diagnostics; 9 using System.Xml.Schema; 10 using System.Drawing.Drawing2D; 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 LinePenStyle : 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 LinePenStyle : 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 LinePenStyle( 28 SerializationInfo info, 29 StreamingContext context) 30 : base(info, context) { 25 31 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 LinePenStyle( 34 SerializationInfo info, 35 StreamingContext context) 36 : base(info, context) 37 { 32 if (Tracing.BinaryDeserializationSwitch.Enabled) { 33 Trace.WriteLine("Deserializing the fields of 'LinePenStyle'."); 34 } 38 35 39 if (Tracing.BinaryDeserializationSwitch.Enabled) 40 { 41 Trace.WriteLine("Deserializing the fields of 'LinePenStyle'."); 42 } 36 double version = info.GetDouble("LinePenStyleVersion"); 43 37 44 double version = info.GetDouble("LinePenStyleVersion"); 38 this.mStartCap = (LineCap)Enum.Parse( 39 typeof(LineCap), 40 info.GetString("StartCap")); 45 41 46 this.mStartCap = (LineCap)Enum.Parse( 47 typeof(LineCap), 48 info.GetString("StartCap")); 42 this.mEndCap = (LineCap)Enum.Parse( 43 typeof(LineCap), 44 info.GetString("EndCap")); 45 } 46 #endregion 49 47 50 this.mEndCap = (LineCap)Enum.Parse( 51 typeof(LineCap), 52 info.GetString("EndCap")); 53 } 54 #endregion 55 56 #region Serialization events 57 /* 48 #region Serialization events 49 /* 58 50 [OnSerializing] 59 51 void OnSerializing(StreamingContext context) … … 67 59 } 68 60 */ 69 61 #endregion 70 62 71 72 63 #region Deserialization events 64 /* 73 65 [OnDeserializing] 74 66 void OnDeserializing(StreamingContext context) … … 84 76 } 85 77 */ 86 78 #endregion 87 79 88 80 #region Serialization 89 81 90 // ------------------------------------------------------------------ 91 /// <summary> 92 /// Populates a <see cref= 93 /// "T:System.Runtime.Serialization.SerializationInfo"></see> with 94 /// the data needed to serialize the target object. 95 /// </summary> 96 /// <param name="info">The <see cref= 97 /// "T:System.Runtime.Serialization.SerializationInfo"></see> to 98 /// populate with data.</param> 99 /// <param name="context">The destination (see <see cref= 100 /// "T:System.Runtime.Serialization.StreamingContext"></see>) for 101 /// this serialization.</param> 102 /// <exception cref="T:System.Security.SecurityException">The caller 103 /// does not have the required permission. </exception> 104 // ------------------------------------------------------------------ 105 public override void GetObjectData( 106 SerializationInfo info, 107 StreamingContext context) 108 { 109 if (Tracing.BinarySerializationSwitch.Enabled) 110 { 111 Trace.WriteLine("Serializing the fields of 'LinePenStyle'."); 112 } 113 base.GetObjectData(info, context); 82 // ------------------------------------------------------------------ 83 /// <summary> 84 /// Populates a <see cref= 85 /// "T:System.Runtime.Serialization.SerializationInfo"></see> with 86 /// the data needed to serialize the target object. 87 /// </summary> 88 /// <param name="info">The <see cref= 89 /// "T:System.Runtime.Serialization.SerializationInfo"></see> to 90 /// populate with data.</param> 91 /// <param name="context">The destination (see <see cref= 92 /// "T:System.Runtime.Serialization.StreamingContext"></see>) for 93 /// this serialization.</param> 94 /// <exception cref="T:System.Security.SecurityException">The caller 95 /// does not have the required permission. </exception> 96 // ------------------------------------------------------------------ 97 public override void GetObjectData( 98 SerializationInfo info, 99 StreamingContext context) { 100 if (Tracing.BinarySerializationSwitch.Enabled) { 101 Trace.WriteLine("Serializing the fields of 'LinePenStyle'."); 102 } 103 base.GetObjectData(info, context); 114 104 115 105 info.AddValue("LinePenStyleVersion", linePenStyleVersion); 116 106 117 // Note that the generalization cap is defined as a static member 118 // in this class. 119 info.AddValue("StartCap", this.mStartCap.ToString()); 120 info.AddValue("EndCap", this.mEndCap.ToString()); 121 122 } 123 #endregion 107 // Note that the generalization cap is defined as a static member 108 // in this class. 109 info.AddValue("StartCap", this.mStartCap.ToString()); 110 info.AddValue("EndCap", this.mEndCap.ToString()); 124 111 125 #region Xml serialization 126 /// <summary> 127 /// This property is reserved, apply the <see cref="T:System.Xml.Serialization.XmlSchemaProviderAttribute"></see> to the class instead. 128 /// </summary> 129 /// <returns> 130 /// 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. 131 /// </returns> 132 public override XmlSchema GetSchema() 133 { 134 throw new NotImplementedException("The method or operation is not implemented."); 135 } 112 } 113 #endregion 136 114 137 /// <summary> 138 /// Generates an object from its XML representation. 139 /// </summary> 140 /// <param name="reader">The <see cref="T:System.Xml.XmlReader"></see> stream from which the object is deserialized.</param> 141 public override void ReadXml(System.Xml.XmlReader reader) 142 { 143 throw new NotImplementedException("The method or operation is not implemented."); 144 } 115 #region Xml serialization 116 /// <summary> 117 /// This property is reserved, apply the <see cref="T:System.Xml.Serialization.XmlSchemaProviderAttribute"></see> to the class instead. 118 /// </summary> 119 /// <returns> 120 /// 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. 121 /// </returns> 122 public override XmlSchema GetSchema() { 123 throw new NotImplementedException("The method or operation is not implemented."); 124 } 145 125 146 /// <summary> 147 /// Converts an object into its XML representation. 148 /// </summary> 149 /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"></see> stream to which the object is serialized.</param> 150 public override void WriteXml(System.Xml.XmlWriter writer) 151 { 152 throw new NotImplementedException("The method or operation is not implemented."); 153 } 154 #endregion 126 /// <summary> 127 /// Generates an object from its XML representation. 128 /// </summary> 129 /// <param name="reader">The <see cref="T:System.Xml.XmlReader"></see> stream from which the object is deserialized.</param> 130 public override void ReadXml(System.Xml.XmlReader reader) { 131 throw new NotImplementedException("The method or operation is not implemented."); 132 } 155 133 156 // ------------------------------------------------------------------ 157 /// <summary> 158 /// Runs when the entire object graph has been deserialized. 159 /// </summary> 160 /// <param name="sender">The object that initiated the callback. The 161 /// functionality for this parameter is not currently implemented. 162 /// </param> 163 // ------------------------------------------------------------------ 164 public override void OnDeserialization(object sender) 165 { 166 if (Tracing.BinaryDeserializationSwitch.Enabled) 167 { 168 Trace.WriteLine( 169 "IDeserializationCallback of 'LinePenStyle' called."); 170 } 171 } 134 /// <summary> 135 /// Converts an object into its XML representation. 136 /// </summary> 137 /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"></see> stream to which the object is serialized.</param> 138 public override void WriteXml(System.Xml.XmlWriter writer) { 139 throw new NotImplementedException("The method or operation is not implemented."); 172 140 } 141 #endregion 142 143 // ------------------------------------------------------------------ 144 /// <summary> 145 /// Runs when the entire object graph has been deserialized. 146 /// </summary> 147 /// <param name="sender">The object that initiated the callback. The 148 /// functionality for this parameter is not currently implemented. 149 /// </param> 150 // ------------------------------------------------------------------ 151 public override void OnDeserialization(object sender) { 152 if (Tracing.BinaryDeserializationSwitch.Enabled) { 153 Trace.WriteLine( 154 "IDeserializationCallback of 'LinePenStyle' called."); 155 } 156 } 157 } 173 158 }
Note: See TracChangeset
for help on using the changeset viewer.