#pragma warning disable 1591, 0114, 0108 // ------------------------------------------------------------------------------ // // Generated by Xsd2Code. Version 3.3.0.33001 // OSGeo.MapGuide.ObjectModels.CommonBindingListCSharpTrueFalseTrueTrueTrueFalseTrueFalseNet20SerializeDeserializeSaveToFileLoadFromFileTrueFalseFalseFalseFalse // // ------------------------------------------------------------------------------ namespace OSGeo.MapGuide.ObjectModels.DrawingSource_1_0_0 { using System; using System.Diagnostics; using System.Xml.Serialization; using System.Collections; using System.Xml.Schema; using System.ComponentModel; using System.IO; using OSGeo.MapGuide.ObjectModels.DrawingSource; /// /// A drawing source is a definition that provides part of the information required to connect to a particular drawing /// [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] public partial class DrawingSource : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private string sourceNameField; [EditorBrowsable(EditorBrowsableState.Never)] private string coordinateSpaceField; [EditorBrowsable(EditorBrowsableState.Never)] private BindingList sheetField; private static System.Xml.Serialization.XmlSerializer serializer; /// /// Specifies the source (pathname) of the drawing /// public string SourceName { get { return this.sourceNameField; } set { if ((this.sourceNameField != null)) { if ((sourceNameField.Equals(value) != true)) { this.sourceNameField = value; this.OnPropertyChanged("SourceName"); } } else { this.sourceNameField = value; this.OnPropertyChanged("SourceName"); } } } /// /// Specifies the coordinate space that is assigned to the drawing. Default is LL84, if none specified. /// public string CoordinateSpace { get { return this.coordinateSpaceField; } set { if ((this.coordinateSpaceField != null)) { if ((coordinateSpaceField.Equals(value) != true)) { this.coordinateSpaceField = value; this.OnPropertyChanged("CoordinateSpace"); } } else { this.coordinateSpaceField = value; this.OnPropertyChanged("CoordinateSpace"); } } } [System.Xml.Serialization.XmlElementAttribute("Sheet")] public BindingList Sheet { get { return this.sheetField; } set { if ((this.sheetField != null)) { if ((sheetField.Equals(value) != true)) { this.sheetField = value; this.OnPropertyChanged("Sheet"); } } else { this.sheetField = value; this.OnPropertyChanged("Sheet"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(DrawingSource)); } return serializer; } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; public virtual void OnPropertyChanged(string info) { System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged; if ((handler != null)) { handler(this, new System.ComponentModel.PropertyChangedEventArgs(info)); } } #region Serialize/Deserialize /// /// Serializes current DrawingSource object into an XML document /// /// string XML value public virtual string Serialize() { System.IO.StreamReader streamReader = null; System.IO.MemoryStream memoryStream = null; try { memoryStream = new System.IO.MemoryStream(); Serializer.Serialize(memoryStream, this); memoryStream.Seek(0, System.IO.SeekOrigin.Begin); streamReader = new System.IO.StreamReader(memoryStream); return streamReader.ReadToEnd(); } finally { if ((streamReader != null)) { streamReader.Dispose(); } if ((memoryStream != null)) { memoryStream.Dispose(); } } } /// /// Deserializes workflow markup into an DrawingSource object /// /// string workflow markup to deserialize /// Output DrawingSource object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool Deserialize(string xml, out DrawingSource obj, out System.Exception exception) { exception = null; obj = default(DrawingSource); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out DrawingSource obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static DrawingSource Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((DrawingSource)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// /// Serializes current DrawingSource object into file /// /// full path of outupt xml file /// output Exception value if failed /// true if can serialize and save into file; otherwise, false public virtual bool SaveToFile(string fileName, out System.Exception exception) { exception = null; try { SaveToFile(fileName); return true; } catch (System.Exception e) { exception = e; return false; } } public virtual void SaveToFile(string fileName) { System.IO.StreamWriter streamWriter = null; try { string xmlString = Serialize(); System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName); streamWriter = xmlFile.CreateText(); streamWriter.WriteLine(xmlString); streamWriter.Close(); } finally { if ((streamWriter != null)) { streamWriter.Dispose(); } } } /// /// Deserializes xml markup from file into an DrawingSource object /// /// string xml file to load and deserialize /// Output DrawingSource object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool LoadFromFile(string fileName, out DrawingSource obj, out System.Exception exception) { exception = null; obj = default(DrawingSource); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out DrawingSource obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static DrawingSource LoadFromFile(string fileName) { System.IO.FileStream file = null; System.IO.StreamReader sr = null; try { file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); sr = new System.IO.StreamReader(file); string xmlString = sr.ReadToEnd(); sr.Close(); file.Close(); return Deserialize(xmlString); } finally { if ((file != null)) { file.Dispose(); } if ((sr != null)) { sr.Dispose(); } } } #endregion #region Clone method /// /// Create a clone of this DrawingSource object /// public virtual DrawingSource Clone() { return ((DrawingSource)(this.MemberwiseClone())); } #endregion } [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class DrawingSourceSheet : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private string nameField; [EditorBrowsable(EditorBrowsableState.Never)] private DrawingSourceSheetExtent extentField; private static System.Xml.Serialization.XmlSerializer serializer; public string Name { get { return this.nameField; } set { if ((this.nameField != null)) { if ((nameField.Equals(value) != true)) { this.nameField = value; this.OnPropertyChanged("Name"); } } else { this.nameField = value; this.OnPropertyChanged("Name"); } } } public DrawingSourceSheetExtent Extent { get { return this.extentField; } set { if ((this.extentField != null)) { if ((extentField.Equals(value) != true)) { this.extentField = value; this.OnPropertyChanged("Extent"); } } else { this.extentField = value; this.OnPropertyChanged("Extent"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(DrawingSourceSheet)); } return serializer; } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; public virtual void OnPropertyChanged(string info) { System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged; if ((handler != null)) { handler(this, new System.ComponentModel.PropertyChangedEventArgs(info)); } } #region Serialize/Deserialize /// /// Serializes current DrawingSourceSheet object into an XML document /// /// string XML value public virtual string Serialize() { System.IO.StreamReader streamReader = null; System.IO.MemoryStream memoryStream = null; try { memoryStream = new System.IO.MemoryStream(); Serializer.Serialize(memoryStream, this); memoryStream.Seek(0, System.IO.SeekOrigin.Begin); streamReader = new System.IO.StreamReader(memoryStream); return streamReader.ReadToEnd(); } finally { if ((streamReader != null)) { streamReader.Dispose(); } if ((memoryStream != null)) { memoryStream.Dispose(); } } } /// /// Deserializes workflow markup into an DrawingSourceSheet object /// /// string workflow markup to deserialize /// Output DrawingSourceSheet object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool Deserialize(string xml, out DrawingSourceSheet obj, out System.Exception exception) { exception = null; obj = default(DrawingSourceSheet); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out DrawingSourceSheet obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static DrawingSourceSheet Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((DrawingSourceSheet)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// /// Serializes current DrawingSourceSheet object into file /// /// full path of outupt xml file /// output Exception value if failed /// true if can serialize and save into file; otherwise, false public virtual bool SaveToFile(string fileName, out System.Exception exception) { exception = null; try { SaveToFile(fileName); return true; } catch (System.Exception e) { exception = e; return false; } } public virtual void SaveToFile(string fileName) { System.IO.StreamWriter streamWriter = null; try { string xmlString = Serialize(); System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName); streamWriter = xmlFile.CreateText(); streamWriter.WriteLine(xmlString); streamWriter.Close(); } finally { if ((streamWriter != null)) { streamWriter.Dispose(); } } } /// /// Deserializes xml markup from file into an DrawingSourceSheet object /// /// string xml file to load and deserialize /// Output DrawingSourceSheet object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool LoadFromFile(string fileName, out DrawingSourceSheet obj, out System.Exception exception) { exception = null; obj = default(DrawingSourceSheet); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out DrawingSourceSheet obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static DrawingSourceSheet LoadFromFile(string fileName) { System.IO.FileStream file = null; System.IO.StreamReader sr = null; try { file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); sr = new System.IO.StreamReader(file); string xmlString = sr.ReadToEnd(); sr.Close(); file.Close(); return Deserialize(xmlString); } finally { if ((file != null)) { file.Dispose(); } if ((sr != null)) { sr.Dispose(); } } } #endregion #region Clone method /// /// Create a clone of this DrawingSourceSheet object /// public virtual DrawingSourceSheet Clone() { return ((DrawingSourceSheet)(this.MemberwiseClone())); } #endregion } [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class DrawingSourceSheetExtent : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private double minXField; [EditorBrowsable(EditorBrowsableState.Never)] private double minYField; [EditorBrowsable(EditorBrowsableState.Never)] private double maxXField; [EditorBrowsable(EditorBrowsableState.Never)] private double maxYField; private static System.Xml.Serialization.XmlSerializer serializer; public double MinX { get { return this.minXField; } set { if ((minXField.Equals(value) != true)) { this.minXField = value; this.OnPropertyChanged("MinX"); } } } public double MinY { get { return this.minYField; } set { if ((minYField.Equals(value) != true)) { this.minYField = value; this.OnPropertyChanged("MinY"); } } } public double MaxX { get { return this.maxXField; } set { if ((maxXField.Equals(value) != true)) { this.maxXField = value; this.OnPropertyChanged("MaxX"); } } } public double MaxY { get { return this.maxYField; } set { if ((maxYField.Equals(value) != true)) { this.maxYField = value; this.OnPropertyChanged("MaxY"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(DrawingSourceSheetExtent)); } return serializer; } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; public virtual void OnPropertyChanged(string info) { System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged; if ((handler != null)) { handler(this, new System.ComponentModel.PropertyChangedEventArgs(info)); } } #region Serialize/Deserialize /// /// Serializes current DrawingSourceSheetExtent object into an XML document /// /// string XML value public virtual string Serialize() { System.IO.StreamReader streamReader = null; System.IO.MemoryStream memoryStream = null; try { memoryStream = new System.IO.MemoryStream(); Serializer.Serialize(memoryStream, this); memoryStream.Seek(0, System.IO.SeekOrigin.Begin); streamReader = new System.IO.StreamReader(memoryStream); return streamReader.ReadToEnd(); } finally { if ((streamReader != null)) { streamReader.Dispose(); } if ((memoryStream != null)) { memoryStream.Dispose(); } } } /// /// Deserializes workflow markup into an DrawingSourceSheetExtent object /// /// string workflow markup to deserialize /// Output DrawingSourceSheetExtent object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool Deserialize(string xml, out DrawingSourceSheetExtent obj, out System.Exception exception) { exception = null; obj = default(DrawingSourceSheetExtent); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out DrawingSourceSheetExtent obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static DrawingSourceSheetExtent Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((DrawingSourceSheetExtent)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// /// Serializes current DrawingSourceSheetExtent object into file /// /// full path of outupt xml file /// output Exception value if failed /// true if can serialize and save into file; otherwise, false public virtual bool SaveToFile(string fileName, out System.Exception exception) { exception = null; try { SaveToFile(fileName); return true; } catch (System.Exception e) { exception = e; return false; } } public virtual void SaveToFile(string fileName) { System.IO.StreamWriter streamWriter = null; try { string xmlString = Serialize(); System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName); streamWriter = xmlFile.CreateText(); streamWriter.WriteLine(xmlString); streamWriter.Close(); } finally { if ((streamWriter != null)) { streamWriter.Dispose(); } } } /// /// Deserializes xml markup from file into an DrawingSourceSheetExtent object /// /// string xml file to load and deserialize /// Output DrawingSourceSheetExtent object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool LoadFromFile(string fileName, out DrawingSourceSheetExtent obj, out System.Exception exception) { exception = null; obj = default(DrawingSourceSheetExtent); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out DrawingSourceSheetExtent obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static DrawingSourceSheetExtent LoadFromFile(string fileName) { System.IO.FileStream file = null; System.IO.StreamReader sr = null; try { file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); sr = new System.IO.StreamReader(file); string xmlString = sr.ReadToEnd(); sr.Close(); file.Close(); return Deserialize(xmlString); } finally { if ((file != null)) { file.Dispose(); } if ((sr != null)) { sr.Dispose(); } } } #endregion #region Clone method /// /// Create a clone of this DrawingSourceSheetExtent object /// public virtual DrawingSourceSheetExtent Clone() { return ((DrawingSourceSheetExtent)(this.MemberwiseClone())); } #endregion } }