Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Serialization/DocumentInformation.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/DocumentInformation.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 DocumentInformation : 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 DocumentInformation : 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 DocumentInformation(SerializationInfo info, StreamingContext context) 25 { 26 if(Tracing.BinaryDeserializationSwitch.Enabled) 27 Trace.WriteLine("Deserializing the fields of 'DocumentInformation'."); 16 /// <param name="info">The info.</param> 17 /// <param name="context">The context.</param> 18 protected DocumentInformation(SerializationInfo info, StreamingContext context) { 19 if (Tracing.BinaryDeserializationSwitch.Enabled) 20 Trace.WriteLine("Deserializing the fields of 'DocumentInformation'."); 28 21 29 22 double version = info.GetDouble("DocumentInfoVersion"); 30 23 31 32 33 34 35 36 24 mAuthor = info.GetString("Author"); 25 mCreationDate = info.GetDateTime("CreationDate").ToString(); 26 mDescription = info.GetString("Description"); 27 mTitle = info.GetString("Title"); 28 } 29 #endregion 37 30 38 39 31 #region Serialization events 32 /* 40 33 [OnSerializing] 41 34 void OnSerializing(StreamingContext context) … … 50 43 Trace.Unindent(); 51 44 } 52 */ 53 45 */ 46 #endregion 54 47 55 56 48 #region Deserialization events 49 /* 57 50 [OnDeserializing] 58 51 void OnDeserializing(StreamingContext context) … … 68 61 } 69 62 */ 70 63 #endregion 71 64 72 65 #region Serialization 73 66 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 'DocumentInformation'."); 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 void GetObjectData(SerializationInfo info, StreamingContext context) { 74 if (Tracing.BinarySerializationSwitch.Enabled) 75 Trace.WriteLine("Serializing the fields of 'DocumentInformation'."); 84 76 85 86 87 88 89 info.AddValue("Title", this.Title);90 91 77 info.AddValue("DocumentInfoVersion", documentInformationVersion); 78 info.AddValue("Author", this.Author); 79 info.AddValue("CreationDate", DateTime.Parse(this.CreationDate)); 80 info.AddValue("Description", this.Description); 81 info.AddValue("Title", this.Title); 82 } 83 #endregion 92 84 93 #region Xml serialization 94 /// <summary> 95 /// This property is reserved, apply the <see cref="T:System.Xml.Serialization.XmlSchemaProviderAttribute"></see> to the class instead. 96 /// </summary> 97 /// <returns> 98 /// 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. 99 /// </returns> 100 public XmlSchema GetSchema() 101 { 102 throw new NotImplementedException("The method or operation is not implemented."); 103 } 85 #region Xml serialization 86 /// <summary> 87 /// This property is reserved, apply the <see cref="T:System.Xml.Serialization.XmlSchemaProviderAttribute"></see> to the class instead. 88 /// </summary> 89 /// <returns> 90 /// 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. 91 /// </returns> 92 public XmlSchema GetSchema() { 93 throw new NotImplementedException("The method or operation is not implemented."); 94 } 104 95 105 /// <summary> 106 /// Generates an object from its XML representation. 107 /// </summary> 108 /// <param name="reader">The <see cref="T:System.Xml.XmlReader"></see> stream from which the object is deserialized.</param> 109 public void ReadXml(System.Xml.XmlReader reader) 110 { 111 throw new NotImplementedException("The method or operation is not implemented."); 112 } 96 /// <summary> 97 /// Generates an object from its XML representation. 98 /// </summary> 99 /// <param name="reader">The <see cref="T:System.Xml.XmlReader"></see> stream from which the object is deserialized.</param> 100 public void ReadXml(System.Xml.XmlReader reader) { 101 throw new NotImplementedException("The method or operation is not implemented."); 102 } 113 103 114 /// <summary> 115 /// Converts an object into its XML representation. 116 /// </summary> 117 /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"></see> stream to which the object is serialized.</param> 118 public void WriteXml(System.Xml.XmlWriter writer) 119 { 120 throw new NotImplementedException("The method or operation is not implemented."); 121 } 122 #endregion 104 /// <summary> 105 /// Converts an object into its XML representation. 106 /// </summary> 107 /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"></see> stream to which the object is serialized.</param> 108 public void WriteXml(System.Xml.XmlWriter writer) { 109 throw new NotImplementedException("The method or operation is not implemented."); 110 } 111 #endregion 123 112 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 void OnDeserialization(object sender) 129 { 130 if(Tracing.BinaryDeserializationSwitch.Enabled) 131 Trace.WriteLine("IDeserializationCallback of 'DocumentInformation' called."); 132 } 113 /// <summary> 114 /// Runs when the entire object graph has been deserialized. 115 /// </summary> 116 /// <param name="sender">The object that initiated the callback. The functionality for this parameter is not currently implemented.</param> 117 public void OnDeserialization(object sender) { 118 if (Tracing.BinaryDeserializationSwitch.Enabled) 119 Trace.WriteLine("IDeserializationCallback of 'DocumentInformation' called."); 133 120 } 121 } 134 122 }
Note: See TracChangeset
for help on using the changeset viewer.