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