Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Serialization/IconMaterial.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/IconMaterial.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 namespace Netron.Diagramming.Core 11 { 7 namespace Netron.Diagramming.Core { 8 /// <summary> 9 /// Complementary partial class related to (de)serialization. 10 /// </summary> 11 [Serializable] 12 public partial class IconMaterial : ISerializable, IXmlSerializable, IDeserializationCallback { 13 #region Deserialization constructor 12 14 /// <summary> 13 /// Complementary partial class related to (de)serialization.15 /// Deserialization constructor 14 16 /// </summary> 15 [Serializable] 16 public partial class IconMaterial : 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 IconMaterial(SerializationInfo info, StreamingContext context) 25 : base(info, context) 26 { 27 if (Tracing.BinaryDeserializationSwitch.Enabled) 28 Trace.WriteLine("Deserializing the fields of 'IconMaterial'."); 17 /// <param name="info">The info.</param> 18 /// <param name="context">The context.</param> 19 protected IconMaterial(SerializationInfo info, StreamingContext context) 20 : base(info, context) { 21 if (Tracing.BinaryDeserializationSwitch.Enabled) 22 Trace.WriteLine("Deserializing the fields of 'IconMaterial'."); 29 23 30 double version = info.GetDouble("IconMaterialVersion"); 31 32 try 33 { 34 mIcon = info.GetValue("Icon", typeof(Bitmap)) as Bitmap; 35 } 36 catch 37 { 38 //never mind, there was no icon originally in the material 39 } 24 double version = info.GetDouble("IconMaterialVersion"); 40 25 41 } 42 #endregion 26 try { 27 mIcon = info.GetValue("Icon", typeof(Bitmap)) as Bitmap; 28 } 29 catch { 30 //never mind, there was no icon originally in the material 31 } 43 32 44 #region Serialization events 45 /* 33 } 34 #endregion 35 36 #region Serialization events 37 /* 46 38 [OnSerializing] 47 39 void OnSerializing(StreamingContext context) … … 57 49 } 58 50 */ 59 51 #endregion 60 52 61 62 53 #region Deserialization events 54 /* 63 55 [OnDeserializing] 64 56 void OnDeserializing(StreamingContext context) … … 74 66 } 75 67 */ 76 68 #endregion 77 69 78 #region Serialization 79 public override void GetObjectData(SerializationInfo info, StreamingContext context) 80 { 81 if (Tracing.BinarySerializationSwitch.Enabled) 82 Trace.WriteLine("Serializing the fields of 'IconMaterial'."); 83 base.GetObjectData(info, context); 70 #region Serialization 71 public override void GetObjectData(SerializationInfo info, StreamingContext context) { 72 if (Tracing.BinarySerializationSwitch.Enabled) 73 Trace.WriteLine("Serializing the fields of 'IconMaterial'."); 74 base.GetObjectData(info, context); 84 75 85 86 87 88 89 76 info.AddValue("IconMaterialVersion", iconMaterialVersion); 77 if (mIcon != null) 78 info.AddValue("Icon", mIcon, typeof(Bitmap)); 79 } 80 #endregion 90 81 91 #region Xml serialization 92 /// <summary> 93 /// This property is reserved, apply the <see cref="T:System.Xml.Serialization.XmlSchemaProviderAttribute"></see> to the class instead. 94 /// </summary> 95 /// <returns> 96 /// 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. 97 /// </returns> 98 public override XmlSchema GetSchema() 99 { 100 throw new NotImplementedException("The method or operation is not implemented."); 101 } 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 } 102 92 103 /// <summary> 104 /// Generates an object from its XML representation. 105 /// </summary> 106 /// <param name="reader">The <see cref="T:System.Xml.XmlReader"></see> stream from which the object is deserialized.</param> 107 public override void ReadXml(System.Xml.XmlReader reader) 108 { 109 throw new NotImplementedException("The method or operation is not implemented."); 110 } 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 } 111 100 112 /// <summary> 113 /// Converts an object into its XML representation. 114 /// </summary> 115 /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"></see> stream to which the object is serialized.</param> 116 public override void WriteXml(System.Xml.XmlWriter writer) 117 { 118 throw new NotImplementedException("The method or operation is not implemented."); 119 } 120 #endregion 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 121 109 122 110 123 111 124 /// <summary> 125 /// Runs when the entire object graph has been deserialized. 126 /// </summary> 127 /// <param name="sender">The object that initiated the callback. The functionality for this parameter is not currently implemented.</param> 128 public override void OnDeserialization(object sender) 129 { 130 base.OnDeserialization(sender); 131 if (Tracing.BinaryDeserializationSwitch.Enabled) 132 Trace.WriteLine("IDeserializationCallback of 'IconMaterial' called."); 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 'IconMaterial' called."); 133 120 134 121 135 }136 122 } 123 } 137 124 }
Note: See TracChangeset
for help on using the changeset viewer.