#pragma warning disable 1591, 0114, 0108 // ------------------------------------------------------------------------------ // <auto-generated> // Generated by Xsd2Code. Version 3.3.0.33001 // <NameSpace>OSGeo.MapGuide.ObjectModels.MapDefinition</NameSpace><Collection>BindingList</Collection><codeType>CSharp</codeType><EnableDataBinding>True</EnableDataBinding><EnableLasyLoading>False</EnableLasyLoading><HidePrivateFieldInIDE>True</HidePrivateFieldInIDE><EnableSummaryComment>True</EnableSummaryComment><IncludeSerializeMethod>True</IncludeSerializeMethod><UseBaseClass>False</UseBaseClass><GenerateCloneMethod>True</GenerateCloneMethod><GenerateDataContracts>False</GenerateDataContracts><CodeBaseTag>Net20</CodeBaseTag><SerializeMethodName>Serialize</SerializeMethodName><DeserializeMethodName>Deserialize</DeserializeMethodName><SaveToFileMethodName>SaveToFile</SaveToFileMethodName><LoadFromFileMethodName>LoadFromFile</LoadFromFileMethodName><GenerateXMLAttributes>True</GenerateXMLAttributes><AutomaticProperties>False</AutomaticProperties><DisableDebug>False</DisableDebug><CustomUsings></CustomUsings><ExcludeIncludedTypes>False</ExcludeIncludedTypes><EnableInitializeFields>False</EnableInitializeFields> // </auto-generated> // ------------------------------------------------------------------------------ namespace OSGeo.MapGuide.ObjectModels.MapDefinition_2_4_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.MaestroAPI; using System.Drawing; using OSGeo.MapGuide.ObjectModels.MapDefinition; using OSGeo.MapGuide.ObjectModels.WatermarkDefinition_2_4_0; /// <summary> /// A MapDefinition defines the collection of layers, groupings of layers, and base map /// </summary> [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 MapDefinition : MapDefinitionType, System.ComponentModel.INotifyPropertyChanged { private static System.Xml.Serialization.XmlSerializer serializer; private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapDefinition)); } return serializer; } } [EditorBrowsable(EditorBrowsableState.Never)] private string versionField; [System.Xml.Serialization.XmlAttributeAttribute()] public string version { get { return this.versionField; } set { if ((this.versionField != null)) { if ((versionField.Equals(value) != true)) { this.versionField = value; this.OnPropertyChanged("version"); } } else { this.versionField = value; this.OnPropertyChanged("version"); } } } #region Serialize/Deserialize /// <summary> /// Serializes current MapDefinition object into an XML document /// </summary> /// <returns>string XML value</returns> 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(); } } } /// <summary> /// Deserializes workflow markup into an MapDefinition object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output MapDefinition object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string xml, out MapDefinition obj, out System.Exception exception) { exception = null; obj = default(MapDefinition); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out MapDefinition obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static MapDefinition Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((MapDefinition)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// <summary> /// Serializes current MapDefinition object into file /// </summary> /// <param name="fileName">full path of outupt xml file</param> /// <param name="exception">output Exception value if failed</param> /// <returns>true if can serialize and save into file; otherwise, false</returns> 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(); } } } /// <summary> /// Deserializes xml markup from file into an MapDefinition object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output MapDefinition object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out MapDefinition obj, out System.Exception exception) { exception = null; obj = default(MapDefinition); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out MapDefinition obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static MapDefinition 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 /// <summary> /// Create a clone of this MapDefinition object /// </summary> public virtual MapDefinition Clone() { return ((MapDefinition)(this.MemberwiseClone())); } #endregion } [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)] public partial class MapDefinitionType : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private string nameField; [EditorBrowsable(EditorBrowsableState.Never)] private string coordinateSystemField; [EditorBrowsable(EditorBrowsableState.Never)] private Box2DType extentsField; [EditorBrowsable(EditorBrowsableState.Never)] private Color backgroundColorField; [EditorBrowsable(EditorBrowsableState.Never)] private string metadataField; [EditorBrowsable(EditorBrowsableState.Never)] private BindingList<MapLayerType> mapLayerField; [EditorBrowsable(EditorBrowsableState.Never)] private BindingList<MapLayerGroupType> mapLayerGroupField; [EditorBrowsable(EditorBrowsableState.Never)] private MapDefinitionTypeBaseMapDefinition baseMapDefinitionField; [EditorBrowsable(EditorBrowsableState.Never)] private BindingList<WatermarkType> watermarksField; 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 string CoordinateSystem { get { return this.coordinateSystemField; } set { if ((this.coordinateSystemField != null)) { if ((coordinateSystemField.Equals(value) != true)) { this.coordinateSystemField = value; this.OnPropertyChanged("CoordinateSystem"); } } else { this.coordinateSystemField = value; this.OnPropertyChanged("CoordinateSystem"); } } } public Box2DType Extents { get { return this.extentsField; } set { if ((this.extentsField != null)) { if ((extentsField.Equals(value) != true)) { this.extentsField = value; this.OnPropertyChanged("Extents"); } } else { this.extentsField = value; this.OnPropertyChanged("Extents"); } } } [System.Xml.Serialization.XmlElementAttribute("BackgroundColor")] public string BackgroundColorAsHtml { get { return Utility.SerializeHTMLColor(this.backgroundColorField, true); } set { var c = Utility.ParseHTMLColor(value); if ((this.backgroundColorField != null)) { if ((backgroundColorField.Equals(c) != true)) { this.backgroundColorField = c; this.OnPropertyChanged("BackgroundColor"); } } else { this.backgroundColorField = c; this.OnPropertyChanged("BackgroundColor"); } } } public string Metadata { get { return this.metadataField; } set { if ((this.metadataField != null)) { if ((metadataField.Equals(value) != true)) { this.metadataField = value; this.OnPropertyChanged("Metadata"); } } else { this.metadataField = value; this.OnPropertyChanged("Metadata"); } } } [System.Xml.Serialization.XmlElementAttribute("MapLayer")] public BindingList<MapLayerType> MapLayer { get { return this.mapLayerField; } set { if ((this.mapLayerField != null)) { if ((mapLayerField.Equals(value) != true)) { this.mapLayerField = value; this.OnPropertyChanged("MapLayer"); } } else { this.mapLayerField = value; this.OnPropertyChanged("MapLayer"); } } } [System.Xml.Serialization.XmlElementAttribute("MapLayerGroup")] public BindingList<MapLayerGroupType> MapLayerGroup { get { return this.mapLayerGroupField; } set { if ((this.mapLayerGroupField != null)) { if ((mapLayerGroupField.Equals(value) != true)) { this.mapLayerGroupField = value; this.OnPropertyChanged("MapLayerGroup"); } } else { this.mapLayerGroupField = value; this.OnPropertyChanged("MapLayerGroup"); } } } public MapDefinitionTypeBaseMapDefinition BaseMapDefinition { get { return this.baseMapDefinitionField; } set { if ((this.baseMapDefinitionField != null)) { if ((baseMapDefinitionField.Equals(value) != true)) { this.baseMapDefinitionField = value; this.OnPropertyChanged("BaseMapDefinition"); } } else { this.baseMapDefinitionField = value; this.OnPropertyChanged("BaseMapDefinition"); } } } [System.Xml.Serialization.XmlArrayItemAttribute("Watermark", IsNullable = false)] public BindingList<WatermarkType> Watermarks { get { return this.watermarksField; } set { if ((this.watermarksField != null)) { if ((watermarksField.Equals(value) != true)) { this.watermarksField = value; this.OnPropertyChanged("Watermarks"); } } else { this.watermarksField = value; this.OnPropertyChanged("Watermarks"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapDefinitionType)); } 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 /// <summary> /// Serializes current MapDefinitionType object into an XML document /// </summary> /// <returns>string XML value</returns> 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(); } } } /// <summary> /// Deserializes workflow markup into an MapDefinitionType object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output MapDefinitionType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string xml, out MapDefinitionType obj, out System.Exception exception) { exception = null; obj = default(MapDefinitionType); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out MapDefinitionType obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static MapDefinitionType Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((MapDefinitionType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// <summary> /// Serializes current MapDefinitionType object into file /// </summary> /// <param name="fileName">full path of outupt xml file</param> /// <param name="exception">output Exception value if failed</param> /// <returns>true if can serialize and save into file; otherwise, false</returns> 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(); } } } /// <summary> /// Deserializes xml markup from file into an MapDefinitionType object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output MapDefinitionType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out MapDefinitionType obj, out System.Exception exception) { exception = null; obj = default(MapDefinitionType); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out MapDefinitionType obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static MapDefinitionType 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 /// <summary> /// Create a clone of this MapDefinitionType object /// </summary> public virtual MapDefinitionType Clone() { return ((MapDefinitionType)(this.MemberwiseClone())); } #endregion } [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)] public partial class Box2DType : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private double minXField; [EditorBrowsable(EditorBrowsableState.Never)] private double maxXField; [EditorBrowsable(EditorBrowsableState.Never)] private double minYField; [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 MaxX { get { return this.maxXField; } set { if ((maxXField.Equals(value) != true)) { this.maxXField = value; this.OnPropertyChanged("MaxX"); } } } public double MinY { get { return this.minYField; } set { if ((minYField.Equals(value) != true)) { this.minYField = value; this.OnPropertyChanged("MinY"); } } } 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(Box2DType)); } 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 /// <summary> /// Serializes current Box2DType object into an XML document /// </summary> /// <returns>string XML value</returns> 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(); } } } /// <summary> /// Deserializes workflow markup into an Box2DType object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output Box2DType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string xml, out Box2DType obj, out System.Exception exception) { exception = null; obj = default(Box2DType); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out Box2DType obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static Box2DType Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((Box2DType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// <summary> /// Serializes current Box2DType object into file /// </summary> /// <param name="fileName">full path of outupt xml file</param> /// <param name="exception">output Exception value if failed</param> /// <returns>true if can serialize and save into file; otherwise, false</returns> 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(); } } } /// <summary> /// Deserializes xml markup from file into an Box2DType object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output Box2DType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out Box2DType obj, out System.Exception exception) { exception = null; obj = default(Box2DType); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out Box2DType obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static Box2DType 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 /// <summary> /// Create a clone of this Box2DType object /// </summary> public virtual Box2DType Clone() { return ((Box2DType)(this.MemberwiseClone())); } #endregion } [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseMapLayerGroupCommonType))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(MapLayerGroupType))] [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)] public partial class MapLayerGroupCommonType : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private string nameField; [EditorBrowsable(EditorBrowsableState.Never)] private bool visibleField; [EditorBrowsable(EditorBrowsableState.Never)] private bool showInLegendField; [EditorBrowsable(EditorBrowsableState.Never)] private bool expandInLegendField; [EditorBrowsable(EditorBrowsableState.Never)] private string legendLabelField; 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 bool Visible { get { return this.visibleField; } set { if ((visibleField.Equals(value) != true)) { this.visibleField = value; this.OnPropertyChanged("Visible"); } } } public bool ShowInLegend { get { return this.showInLegendField; } set { if ((showInLegendField.Equals(value) != true)) { this.showInLegendField = value; this.OnPropertyChanged("ShowInLegend"); } } } public bool ExpandInLegend { get { return this.expandInLegendField; } set { if ((expandInLegendField.Equals(value) != true)) { this.expandInLegendField = value; this.OnPropertyChanged("ExpandInLegend"); } } } public string LegendLabel { get { return this.legendLabelField; } set { if ((this.legendLabelField != null)) { if ((legendLabelField.Equals(value) != true)) { this.legendLabelField = value; this.OnPropertyChanged("LegendLabel"); } } else { this.legendLabelField = value; this.OnPropertyChanged("LegendLabel"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapLayerGroupCommonType)); } 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 /// <summary> /// Serializes current MapLayerGroupCommonType object into an XML document /// </summary> /// <returns>string XML value</returns> 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(); } } } /// <summary> /// Deserializes workflow markup into an MapLayerGroupCommonType object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output MapLayerGroupCommonType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string xml, out MapLayerGroupCommonType obj, out System.Exception exception) { exception = null; obj = default(MapLayerGroupCommonType); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out MapLayerGroupCommonType obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static MapLayerGroupCommonType Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((MapLayerGroupCommonType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// <summary> /// Serializes current MapLayerGroupCommonType object into file /// </summary> /// <param name="fileName">full path of outupt xml file</param> /// <param name="exception">output Exception value if failed</param> /// <returns>true if can serialize and save into file; otherwise, false</returns> 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(); } } } /// <summary> /// Deserializes xml markup from file into an MapLayerGroupCommonType object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output MapLayerGroupCommonType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out MapLayerGroupCommonType obj, out System.Exception exception) { exception = null; obj = default(MapLayerGroupCommonType); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out MapLayerGroupCommonType obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static MapLayerGroupCommonType 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 /// <summary> /// Create a clone of this MapLayerGroupCommonType object /// </summary> public virtual MapLayerGroupCommonType Clone() { return ((MapLayerGroupCommonType)(this.MemberwiseClone())); } #endregion } [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)] public partial class BaseMapLayerGroupCommonType : MapLayerGroupCommonType, System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private BindingList<BaseMapLayerType> baseMapLayerField; private static System.Xml.Serialization.XmlSerializer serializer; [System.Xml.Serialization.XmlElementAttribute("BaseMapLayer")] public BindingList<BaseMapLayerType> BaseMapLayer { get { return this.baseMapLayerField; } set { if ((this.baseMapLayerField != null)) { if ((baseMapLayerField.Equals(value) != true)) { this.baseMapLayerField = value; this.OnPropertyChanged("BaseMapLayer"); } } else { this.baseMapLayerField = value; this.OnPropertyChanged("BaseMapLayer"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(BaseMapLayerGroupCommonType)); } 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 /// <summary> /// Serializes current BaseMapLayerGroupCommonType object into an XML document /// </summary> /// <returns>string XML value</returns> 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(); } } } /// <summary> /// Deserializes workflow markup into an BaseMapLayerGroupCommonType object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output BaseMapLayerGroupCommonType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string xml, out BaseMapLayerGroupCommonType obj, out System.Exception exception) { exception = null; obj = default(BaseMapLayerGroupCommonType); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out BaseMapLayerGroupCommonType obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static BaseMapLayerGroupCommonType Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((BaseMapLayerGroupCommonType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// <summary> /// Serializes current BaseMapLayerGroupCommonType object into file /// </summary> /// <param name="fileName">full path of outupt xml file</param> /// <param name="exception">output Exception value if failed</param> /// <returns>true if can serialize and save into file; otherwise, false</returns> 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(); } } } /// <summary> /// Deserializes xml markup from file into an BaseMapLayerGroupCommonType object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output BaseMapLayerGroupCommonType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out BaseMapLayerGroupCommonType obj, out System.Exception exception) { exception = null; obj = default(BaseMapLayerGroupCommonType); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out BaseMapLayerGroupCommonType obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static BaseMapLayerGroupCommonType 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 /// <summary> /// Create a clone of this BaseMapLayerGroupCommonType object /// </summary> public virtual BaseMapLayerGroupCommonType Clone() { return ((BaseMapLayerGroupCommonType)(this.MemberwiseClone())); } #endregion } [System.Xml.Serialization.XmlIncludeAttribute(typeof(MapLayerType))] [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)] public partial class BaseMapLayerType : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private string nameField; [EditorBrowsable(EditorBrowsableState.Never)] private string resourceIdField; [EditorBrowsable(EditorBrowsableState.Never)] private bool selectableField; [EditorBrowsable(EditorBrowsableState.Never)] private bool showInLegendField; [EditorBrowsable(EditorBrowsableState.Never)] private string legendLabelField; [EditorBrowsable(EditorBrowsableState.Never)] private bool expandInLegendField; 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 string ResourceId { get { return this.resourceIdField; } set { if ((this.resourceIdField != null)) { if ((resourceIdField.Equals(value) != true)) { this.resourceIdField = value; this.OnPropertyChanged("ResourceId"); } } else { this.resourceIdField = value; this.OnPropertyChanged("ResourceId"); } } } public bool Selectable { get { return this.selectableField; } set { if ((selectableField.Equals(value) != true)) { this.selectableField = value; this.OnPropertyChanged("Selectable"); } } } public bool ShowInLegend { get { return this.showInLegendField; } set { if ((showInLegendField.Equals(value) != true)) { this.showInLegendField = value; this.OnPropertyChanged("ShowInLegend"); } } } public string LegendLabel { get { return this.legendLabelField; } set { if ((this.legendLabelField != null)) { if ((legendLabelField.Equals(value) != true)) { this.legendLabelField = value; this.OnPropertyChanged("LegendLabel"); } } else { this.legendLabelField = value; this.OnPropertyChanged("LegendLabel"); } } } public bool ExpandInLegend { get { return this.expandInLegendField; } set { if ((expandInLegendField.Equals(value) != true)) { this.expandInLegendField = value; this.OnPropertyChanged("ExpandInLegend"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(BaseMapLayerType)); } 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 /// <summary> /// Serializes current BaseMapLayerType object into an XML document /// </summary> /// <returns>string XML value</returns> 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(); } } } /// <summary> /// Deserializes workflow markup into an BaseMapLayerType object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output BaseMapLayerType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string xml, out BaseMapLayerType obj, out System.Exception exception) { exception = null; obj = default(BaseMapLayerType); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out BaseMapLayerType obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static BaseMapLayerType Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((BaseMapLayerType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// <summary> /// Serializes current BaseMapLayerType object into file /// </summary> /// <param name="fileName">full path of outupt xml file</param> /// <param name="exception">output Exception value if failed</param> /// <returns>true if can serialize and save into file; otherwise, false</returns> 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(); } } } /// <summary> /// Deserializes xml markup from file into an BaseMapLayerType object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output BaseMapLayerType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out BaseMapLayerType obj, out System.Exception exception) { exception = null; obj = default(BaseMapLayerType); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out BaseMapLayerType obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static BaseMapLayerType 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 /// <summary> /// Create a clone of this BaseMapLayerType object /// </summary> public virtual BaseMapLayerType Clone() { return ((BaseMapLayerType)(this.MemberwiseClone())); } #endregion } [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)] public partial class MapLayerType : BaseMapLayerType, System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private bool visibleField; [EditorBrowsable(EditorBrowsableState.Never)] private string groupField; private static System.Xml.Serialization.XmlSerializer serializer; public bool Visible { get { return this.visibleField; } set { if ((visibleField.Equals(value) != true)) { this.visibleField = value; this.OnPropertyChanged("Visible"); } } } public string Group { get { return this.groupField; } set { if ((this.groupField != null)) { if ((groupField.Equals(value) != true)) { this.groupField = value; this.OnPropertyChanged("Group"); } } else { this.groupField = value; this.OnPropertyChanged("Group"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapLayerType)); } 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 /// <summary> /// Serializes current MapLayerType object into an XML document /// </summary> /// <returns>string XML value</returns> 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(); } } } /// <summary> /// Deserializes workflow markup into an MapLayerType object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output MapLayerType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string xml, out MapLayerType obj, out System.Exception exception) { exception = null; obj = default(MapLayerType); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out MapLayerType obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static MapLayerType Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((MapLayerType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// <summary> /// Serializes current MapLayerType object into file /// </summary> /// <param name="fileName">full path of outupt xml file</param> /// <param name="exception">output Exception value if failed</param> /// <returns>true if can serialize and save into file; otherwise, false</returns> 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(); } } } /// <summary> /// Deserializes xml markup from file into an MapLayerType object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output MapLayerType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out MapLayerType obj, out System.Exception exception) { exception = null; obj = default(MapLayerType); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out MapLayerType obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static MapLayerType 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 /// <summary> /// Create a clone of this MapLayerType object /// </summary> public virtual MapLayerType Clone() { return ((MapLayerType)(this.MemberwiseClone())); } #endregion } [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)] public partial class MapLayerGroupType : MapLayerGroupCommonType, System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private string groupField; private static System.Xml.Serialization.XmlSerializer serializer; public string Group { get { return this.groupField; } set { if ((this.groupField != null)) { if ((groupField.Equals(value) != true)) { this.groupField = value; this.OnPropertyChanged("Group"); } } else { this.groupField = value; this.OnPropertyChanged("Group"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapLayerGroupType)); } 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 /// <summary> /// Serializes current MapLayerGroupType object into an XML document /// </summary> /// <returns>string XML value</returns> 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(); } } } /// <summary> /// Deserializes workflow markup into an MapLayerGroupType object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output MapLayerGroupType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string xml, out MapLayerGroupType obj, out System.Exception exception) { exception = null; obj = default(MapLayerGroupType); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out MapLayerGroupType obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static MapLayerGroupType Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((MapLayerGroupType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// <summary> /// Serializes current MapLayerGroupType object into file /// </summary> /// <param name="fileName">full path of outupt xml file</param> /// <param name="exception">output Exception value if failed</param> /// <returns>true if can serialize and save into file; otherwise, false</returns> 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(); } } } /// <summary> /// Deserializes xml markup from file into an MapLayerGroupType object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output MapLayerGroupType object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out MapLayerGroupType obj, out System.Exception exception) { exception = null; obj = default(MapLayerGroupType); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out MapLayerGroupType obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static MapLayerGroupType 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 /// <summary> /// Create a clone of this MapLayerGroupType object /// </summary> public virtual MapLayerGroupType Clone() { return ((MapLayerGroupType)(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 MapDefinitionTypeBaseMapDefinition : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private BindingList<double> finiteDisplayScaleField; [EditorBrowsable(EditorBrowsableState.Never)] private BindingList<BaseMapLayerGroupCommonType> baseMapLayerGroupField; private static System.Xml.Serialization.XmlSerializer serializer; [System.Xml.Serialization.XmlElementAttribute("FiniteDisplayScale")] public BindingList<double> FiniteDisplayScale { get { return this.finiteDisplayScaleField; } set { if ((this.finiteDisplayScaleField != null)) { if ((finiteDisplayScaleField.Equals(value) != true)) { this.finiteDisplayScaleField = value; this.OnPropertyChanged("FiniteDisplayScale"); } } else { this.finiteDisplayScaleField = value; this.OnPropertyChanged("FiniteDisplayScale"); } } } [System.Xml.Serialization.XmlElementAttribute("BaseMapLayerGroup")] public BindingList<BaseMapLayerGroupCommonType> BaseMapLayerGroup { get { return this.baseMapLayerGroupField; } set { if ((this.baseMapLayerGroupField != null)) { if ((baseMapLayerGroupField.Equals(value) != true)) { this.baseMapLayerGroupField = value; this.OnPropertyChanged("BaseMapLayerGroup"); } } else { this.baseMapLayerGroupField = value; this.OnPropertyChanged("BaseMapLayerGroup"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapDefinitionTypeBaseMapDefinition)); } 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 /// <summary> /// Serializes current MapDefinitionTypeBaseMapDefinition object into an XML document /// </summary> /// <returns>string XML value</returns> 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(); } } } /// <summary> /// Deserializes workflow markup into an MapDefinitionTypeBaseMapDefinition object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output MapDefinitionTypeBaseMapDefinition object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool Deserialize(string xml, out MapDefinitionTypeBaseMapDefinition obj, out System.Exception exception) { exception = null; obj = default(MapDefinitionTypeBaseMapDefinition); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out MapDefinitionTypeBaseMapDefinition obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static MapDefinitionTypeBaseMapDefinition Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((MapDefinitionTypeBaseMapDefinition)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// <summary> /// Serializes current MapDefinitionTypeBaseMapDefinition object into file /// </summary> /// <param name="fileName">full path of outupt xml file</param> /// <param name="exception">output Exception value if failed</param> /// <returns>true if can serialize and save into file; otherwise, false</returns> 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(); } } } /// <summary> /// Deserializes xml markup from file into an MapDefinitionTypeBaseMapDefinition object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output MapDefinitionTypeBaseMapDefinition object</param> /// <param name="exception">output Exception value if deserialize failed</param> /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns> public static bool LoadFromFile(string fileName, out MapDefinitionTypeBaseMapDefinition obj, out System.Exception exception) { exception = null; obj = default(MapDefinitionTypeBaseMapDefinition); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out MapDefinitionTypeBaseMapDefinition obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static MapDefinitionTypeBaseMapDefinition 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 /// <summary> /// Create a clone of this MapDefinitionTypeBaseMapDefinition object /// </summary> public virtual MapDefinitionTypeBaseMapDefinition Clone() { return ((MapDefinitionTypeBaseMapDefinition)(this.MemberwiseClone())); } #endregion } }