// ------------------------------------------------------------------------------ // // Generated by Xsd2Code. Version 3.4.0.32989 // OSGeo.MapGuide.ObjectModels.TileProviderListBindingListCSharpTrueFalseFalseFalseTrueTrueFalseTrueFalseFalseTrueFalseNet20SerializeDeserializeSaveToFileLoadFromFileTrueFalseFalseFalseFalseFalseDefaultUTF8FalseFalse // // ------------------------------------------------------------------------------ namespace OSGeo.MapGuide.ObjectModels.TileProviderList { using System; using System.Diagnostics; using System.Xml.Serialization; using System.Collections; using System.Xml.Schema; using System.ComponentModel; using System.IO; using System.Text; /// /// Root element that contains a collection of TileProvider elements. /// [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.32990")] [System.SerializableAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] public partial class TileProviderList : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private BindingList tileProviderField; private static System.Xml.Serialization.XmlSerializer serializer; /// /// Describes an installed tile provider. /// [System.Xml.Serialization.XmlElementAttribute("TileProvider")] public BindingList TileProvider { get { return this.tileProviderField; } set { if ((this.tileProviderField != null)) { if ((tileProviderField.Equals(value) != true)) { this.tileProviderField = value; this.OnPropertyChanged("TileProvider"); } } else { this.tileProviderField = value; this.OnPropertyChanged("TileProvider"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(TileProviderList)); } return serializer; } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; public virtual void OnPropertyChanged(string propertyName) { System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged; if ((handler != null)) { handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); } } #region Serialize/Deserialize /// /// Serializes current TileProviderList 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 TileProviderList object /// /// string workflow markup to deserialize /// Output TileProviderList object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool Deserialize(string xml, out TileProviderList obj, out System.Exception exception) { exception = null; obj = default(TileProviderList); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out TileProviderList obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static TileProviderList Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((TileProviderList)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// /// Serializes current TileProviderList 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 TileProviderList object /// /// string xml file to load and deserialize /// Output TileProviderList object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool LoadFromFile(string fileName, out TileProviderList obj, out System.Exception exception) { exception = null; obj = default(TileProviderList); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out TileProviderList obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static TileProviderList 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 TileProviderList object /// public virtual TileProviderList Clone() { return ((TileProviderList)(this.MemberwiseClone())); } #endregion } /// /// Describes an installed tile provider. /// [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.32990")] [System.SerializableAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class TileProviderListTileProvider : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private string nameField; [EditorBrowsable(EditorBrowsableState.Never)] private string displayNameField; [EditorBrowsable(EditorBrowsableState.Never)] private string descriptionField; [EditorBrowsable(EditorBrowsableState.Never)] private BindingList connectionPropertiesField; private static System.Xml.Serialization.XmlSerializer serializer; /// /// Unique name of the feature provider. This name should be of the form ..lt;Version>. /// 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"); } } } /// /// A user friendly display name of the feature provider. /// public string DisplayName { get { return this.displayNameField; } set { if ((this.displayNameField != null)) { if ((displayNameField.Equals(value) != true)) { this.displayNameField = value; this.OnPropertyChanged("DisplayName"); } } else { this.displayNameField = value; this.OnPropertyChanged("DisplayName"); } } } /// /// A brief description of the feature provider. /// public string Description { get { return this.descriptionField; } set { if ((this.descriptionField != null)) { if ((descriptionField.Equals(value) != true)) { this.descriptionField = value; this.OnPropertyChanged("Description"); } } else { this.descriptionField = value; this.OnPropertyChanged("Description"); } } } /// /// Connection properties for each provider with default values will be listed here. /// [System.Xml.Serialization.XmlArrayItemAttribute("ConnectionProperty", IsNullable=false)] public BindingList ConnectionProperties { get { return this.connectionPropertiesField; } set { if ((this.connectionPropertiesField != null)) { if ((connectionPropertiesField.Equals(value) != true)) { this.connectionPropertiesField = value; this.OnPropertyChanged("ConnectionProperties"); } } else { this.connectionPropertiesField = value; this.OnPropertyChanged("ConnectionProperties"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(TileProviderListTileProvider)); } return serializer; } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; public virtual void OnPropertyChanged(string propertyName) { System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged; if ((handler != null)) { handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); } } #region Serialize/Deserialize /// /// Serializes current TileProviderListTileProvider 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 TileProviderListTileProvider object /// /// string workflow markup to deserialize /// Output TileProviderListTileProvider object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool Deserialize(string xml, out TileProviderListTileProvider obj, out System.Exception exception) { exception = null; obj = default(TileProviderListTileProvider); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out TileProviderListTileProvider obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static TileProviderListTileProvider Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((TileProviderListTileProvider)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// /// Serializes current TileProviderListTileProvider 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 TileProviderListTileProvider object /// /// string xml file to load and deserialize /// Output TileProviderListTileProvider object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool LoadFromFile(string fileName, out TileProviderListTileProvider obj, out System.Exception exception) { exception = null; obj = default(TileProviderListTileProvider); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out TileProviderListTileProvider obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static TileProviderListTileProvider 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 TileProviderListTileProvider object /// public virtual TileProviderListTileProvider Clone() { return ((TileProviderListTileProvider)(this.MemberwiseClone())); } #endregion } [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.32990")] [System.SerializableAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class TileProviderListTileProviderConnectionProperty : System.ComponentModel.INotifyPropertyChanged { [EditorBrowsable(EditorBrowsableState.Never)] private string nameField; [EditorBrowsable(EditorBrowsableState.Never)] private string localizedNameField; [EditorBrowsable(EditorBrowsableState.Never)] private string defaultValueField; [EditorBrowsable(EditorBrowsableState.Never)] private BindingList valueField; [EditorBrowsable(EditorBrowsableState.Never)] private bool requiredField; [EditorBrowsable(EditorBrowsableState.Never)] private bool protectedField; [EditorBrowsable(EditorBrowsableState.Never)] private bool enumerableField; 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 LocalizedName { get { return this.localizedNameField; } set { if ((this.localizedNameField != null)) { if ((localizedNameField.Equals(value) != true)) { this.localizedNameField = value; this.OnPropertyChanged("LocalizedName"); } } else { this.localizedNameField = value; this.OnPropertyChanged("LocalizedName"); } } } public string DefaultValue { get { return this.defaultValueField; } set { if ((this.defaultValueField != null)) { if ((defaultValueField.Equals(value) != true)) { this.defaultValueField = value; this.OnPropertyChanged("DefaultValue"); } } else { this.defaultValueField = value; this.OnPropertyChanged("DefaultValue"); } } } [System.Xml.Serialization.XmlElementAttribute("Value")] public BindingList Value { get { return this.valueField; } set { if ((this.valueField != null)) { if ((valueField.Equals(value) != true)) { this.valueField = value; this.OnPropertyChanged("Value"); } } else { this.valueField = value; this.OnPropertyChanged("Value"); } } } [System.Xml.Serialization.XmlAttributeAttribute()] public bool Required { get { return this.requiredField; } set { if ((requiredField.Equals(value) != true)) { this.requiredField = value; this.OnPropertyChanged("Required"); } } } [System.Xml.Serialization.XmlAttributeAttribute()] public bool Protected { get { return this.protectedField; } set { if ((protectedField.Equals(value) != true)) { this.protectedField = value; this.OnPropertyChanged("Protected"); } } } [System.Xml.Serialization.XmlAttributeAttribute()] public bool Enumerable { get { return this.enumerableField; } set { if ((enumerableField.Equals(value) != true)) { this.enumerableField = value; this.OnPropertyChanged("Enumerable"); } } } private static System.Xml.Serialization.XmlSerializer Serializer { get { if ((serializer == null)) { serializer = new System.Xml.Serialization.XmlSerializer(typeof(TileProviderListTileProviderConnectionProperty)); } return serializer; } } public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; public virtual void OnPropertyChanged(string propertyName) { System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged; if ((handler != null)) { handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); } } #region Serialize/Deserialize /// /// Serializes current TileProviderListTileProviderConnectionProperty 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 TileProviderListTileProviderConnectionProperty object /// /// string workflow markup to deserialize /// Output TileProviderListTileProviderConnectionProperty object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool Deserialize(string xml, out TileProviderListTileProviderConnectionProperty obj, out System.Exception exception) { exception = null; obj = default(TileProviderListTileProviderConnectionProperty); try { obj = Deserialize(xml); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool Deserialize(string xml, out TileProviderListTileProviderConnectionProperty obj) { System.Exception exception = null; return Deserialize(xml, out obj, out exception); } public static TileProviderListTileProviderConnectionProperty Deserialize(string xml) { System.IO.StringReader stringReader = null; try { stringReader = new System.IO.StringReader(xml); return ((TileProviderListTileProviderConnectionProperty)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader)))); } finally { if ((stringReader != null)) { stringReader.Dispose(); } } } /// /// Serializes current TileProviderListTileProviderConnectionProperty 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 TileProviderListTileProviderConnectionProperty object /// /// string xml file to load and deserialize /// Output TileProviderListTileProviderConnectionProperty object /// output Exception value if deserialize failed /// true if this XmlSerializer can deserialize the object; otherwise, false public static bool LoadFromFile(string fileName, out TileProviderListTileProviderConnectionProperty obj, out System.Exception exception) { exception = null; obj = default(TileProviderListTileProviderConnectionProperty); try { obj = LoadFromFile(fileName); return true; } catch (System.Exception ex) { exception = ex; return false; } } public static bool LoadFromFile(string fileName, out TileProviderListTileProviderConnectionProperty obj) { System.Exception exception = null; return LoadFromFile(fileName, out obj, out exception); } public static TileProviderListTileProviderConnectionProperty 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 TileProviderListTileProviderConnectionProperty object /// public virtual TileProviderListTileProviderConnectionProperty Clone() { return ((TileProviderListTileProviderConnectionProperty)(this.MemberwiseClone())); } #endregion } }