#pragma warning disable 1591, 0114, 0108
// ------------------------------------------------------------------------------
//  <auto-generated>
//    Generated by Xsd2Code. Version 3.3.0.33001
//    <NameSpace>OSGeo.MapGuide.ObjectModels.FeatureSource</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.FeatureSource_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.FeatureSource;
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlRootAttribute("FeatureSource", Namespace="", IsNullable=false)]
    public partial class FeatureSourceType : System.ComponentModel.INotifyPropertyChanged {
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string providerField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private BindingList<NameValuePairType> parameterField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private BindingList<SpatialContextType> supplementalSpatialContextInfoField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string configurationDocumentField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string longTransactionField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private BindingList<FeatureSourceTypeExtension> extensionField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private ExtendedDataType extendedData1Field;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string versionField;
        
        private static System.Xml.Serialization.XmlSerializer serializer;
        
        public string Provider {
            get {
                return this.providerField;
            }
            set {
                if ((this.providerField != null)) {
                    if ((providerField.Equals(value) != true)) {
                        this.providerField = value;
                        this.OnPropertyChanged("Provider");
                    }
                }
                else {
                    this.providerField = value;
                    this.OnPropertyChanged("Provider");
                }
            }
        }
        
        [System.Xml.Serialization.XmlElementAttribute("Parameter")]
        public BindingList<NameValuePairType> Parameter {
            get {
                return this.parameterField;
            }
            set {
                if ((this.parameterField != null)) {
                    if ((parameterField.Equals(value) != true)) {
                        this.parameterField = value;
                        this.OnPropertyChanged("Parameter");
                    }
                }
                else {
                    this.parameterField = value;
                    this.OnPropertyChanged("Parameter");
                }
            }
        }
        
        [System.Xml.Serialization.XmlElementAttribute("SupplementalSpatialContextInfo")]
        public BindingList<SpatialContextType> SupplementalSpatialContextInfo {
            get {
                return this.supplementalSpatialContextInfoField;
            }
            set {
                if ((this.supplementalSpatialContextInfoField != null)) {
                    if ((supplementalSpatialContextInfoField.Equals(value) != true)) {
                        this.supplementalSpatialContextInfoField = value;
                        this.OnPropertyChanged("SupplementalSpatialContextInfo");
                    }
                }
                else {
                    this.supplementalSpatialContextInfoField = value;
                    this.OnPropertyChanged("SupplementalSpatialContextInfo");
                }
            }
        }
        
        public string ConfigurationDocument {
            get {
                return this.configurationDocumentField;
            }
            set {
                if ((this.configurationDocumentField != null)) {
                    if ((configurationDocumentField.Equals(value) != true)) {
                        this.configurationDocumentField = value;
                        this.OnPropertyChanged("ConfigurationDocument");
                    }
                }
                else {
                    this.configurationDocumentField = value;
                    this.OnPropertyChanged("ConfigurationDocument");
                }
            }
        }
        
        public string LongTransaction {
            get {
                return this.longTransactionField;
            }
            set {
                if ((this.longTransactionField != null)) {
                    if ((longTransactionField.Equals(value) != true)) {
                        this.longTransactionField = value;
                        this.OnPropertyChanged("LongTransaction");
                    }
                }
                else {
                    this.longTransactionField = value;
                    this.OnPropertyChanged("LongTransaction");
                }
            }
        }
        
        [System.Xml.Serialization.XmlElementAttribute("Extension")]
        public BindingList<FeatureSourceTypeExtension> Extension {
            get {
                return this.extensionField;
            }
            set {
                if ((this.extensionField != null)) {
                    if ((extensionField.Equals(value) != true)) {
                        this.extensionField = value;
                        this.OnPropertyChanged("Extension");
                    }
                }
                else {
                    this.extensionField = value;
                    this.OnPropertyChanged("Extension");
                }
            }
        }
        
        public ExtendedDataType ExtendedData1 {
            get {
                return this.extendedData1Field;
            }
            set {
                if ((this.extendedData1Field != null)) {
                    if ((extendedData1Field.Equals(value) != true)) {
                        this.extendedData1Field = value;
                        this.OnPropertyChanged("ExtendedData1");
                    }
                }
                else {
                    this.extendedData1Field = value;
                    this.OnPropertyChanged("ExtendedData1");
                }
            }
        }
        
        [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");
                }
            }
        }
        
        private static System.Xml.Serialization.XmlSerializer Serializer {
            get {
                if ((serializer == null)) {
                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(FeatureSourceType));
                }
                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 FeatureSourceType 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 FeatureSourceType object
        /// </summary>
        /// <param name="xml">string workflow markup to deserialize</param>
        /// <param name="obj">Output FeatureSourceType 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 FeatureSourceType obj, out System.Exception exception) {
            exception = null;
            obj = default(FeatureSourceType);
            try {
                obj = Deserialize(xml);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool Deserialize(string xml, out FeatureSourceType obj) {
            System.Exception exception = null;
            return Deserialize(xml, out obj, out exception);
        }
        
        public static FeatureSourceType Deserialize(string xml) {
            System.IO.StringReader stringReader = null;
            try {
                stringReader = new System.IO.StringReader(xml);
                return ((FeatureSourceType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
            }
            finally {
                if ((stringReader != null)) {
                    stringReader.Dispose();
                }
            }
        }
        
        /// <summary>
        /// Serializes current FeatureSourceType 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 FeatureSourceType object
        /// </summary>
        /// <param name="fileName">string xml file to load and deserialize</param>
        /// <param name="obj">Output FeatureSourceType 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 FeatureSourceType obj, out System.Exception exception) {
            exception = null;
            obj = default(FeatureSourceType);
            try {
                obj = LoadFromFile(fileName);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool LoadFromFile(string fileName, out FeatureSourceType obj) {
            System.Exception exception = null;
            return LoadFromFile(fileName, out obj, out exception);
        }
        
        public static FeatureSourceType 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 FeatureSourceType object
        /// </summary>
        public virtual FeatureSourceType Clone() {
            return ((FeatureSourceType)(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 NameValuePairType : System.ComponentModel.INotifyPropertyChanged {
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string nameField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string valueField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private ExtendedDataType extendedData1Field;
        
        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 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");
                }
            }
        }
        
        public ExtendedDataType ExtendedData1 {
            get {
                return this.extendedData1Field;
            }
            set {
                if ((this.extendedData1Field != null)) {
                    if ((extendedData1Field.Equals(value) != true)) {
                        this.extendedData1Field = value;
                        this.OnPropertyChanged("ExtendedData1");
                    }
                }
                else {
                    this.extendedData1Field = value;
                    this.OnPropertyChanged("ExtendedData1");
                }
            }
        }
        
        private static System.Xml.Serialization.XmlSerializer Serializer {
            get {
                if ((serializer == null)) {
                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(NameValuePairType));
                }
                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 NameValuePairType 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 NameValuePairType object
        /// </summary>
        /// <param name="xml">string workflow markup to deserialize</param>
        /// <param name="obj">Output NameValuePairType 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 NameValuePairType obj, out System.Exception exception) {
            exception = null;
            obj = default(NameValuePairType);
            try {
                obj = Deserialize(xml);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool Deserialize(string xml, out NameValuePairType obj) {
            System.Exception exception = null;
            return Deserialize(xml, out obj, out exception);
        }
        
        public static NameValuePairType Deserialize(string xml) {
            System.IO.StringReader stringReader = null;
            try {
                stringReader = new System.IO.StringReader(xml);
                return ((NameValuePairType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
            }
            finally {
                if ((stringReader != null)) {
                    stringReader.Dispose();
                }
            }
        }
        
        /// <summary>
        /// Serializes current NameValuePairType 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 NameValuePairType object
        /// </summary>
        /// <param name="fileName">string xml file to load and deserialize</param>
        /// <param name="obj">Output NameValuePairType 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 NameValuePairType obj, out System.Exception exception) {
            exception = null;
            obj = default(NameValuePairType);
            try {
                obj = LoadFromFile(fileName);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool LoadFromFile(string fileName, out NameValuePairType obj) {
            System.Exception exception = null;
            return LoadFromFile(fileName, out obj, out exception);
        }
        
        public static NameValuePairType 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 NameValuePairType object
        /// </summary>
        public virtual NameValuePairType Clone() {
            return ((NameValuePairType)(this.MemberwiseClone()));
        }
        #endregion
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class ExtendedDataType : System.ComponentModel.INotifyPropertyChanged {
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private System.Xml.XmlElement[] anyField;
        
        private static System.Xml.Serialization.XmlSerializer serializer;
        
        [System.Xml.Serialization.XmlAnyElementAttribute()]
        public System.Xml.XmlElement[] Any
        {
            get {
                return this.anyField;
            }
            set {
                if ((this.anyField != null)) {
                    if ((anyField.Equals(value) != true)) {
                        this.anyField = value;
                        this.OnPropertyChanged("Any");
                    }
                }
                else {
                    this.anyField = value;
                    this.OnPropertyChanged("Any");
                }
            }
        }
        
        private static System.Xml.Serialization.XmlSerializer Serializer {
            get {
                if ((serializer == null)) {
                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(ExtendedDataType));
                }
                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 ExtendedDataType 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 ExtendedDataType object
        /// </summary>
        /// <param name="xml">string workflow markup to deserialize</param>
        /// <param name="obj">Output ExtendedDataType 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 ExtendedDataType obj, out System.Exception exception) {
            exception = null;
            obj = default(ExtendedDataType);
            try {
                obj = Deserialize(xml);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool Deserialize(string xml, out ExtendedDataType obj) {
            System.Exception exception = null;
            return Deserialize(xml, out obj, out exception);
        }
        
        public static ExtendedDataType Deserialize(string xml) {
            System.IO.StringReader stringReader = null;
            try {
                stringReader = new System.IO.StringReader(xml);
                return ((ExtendedDataType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
            }
            finally {
                if ((stringReader != null)) {
                    stringReader.Dispose();
                }
            }
        }
        
        /// <summary>
        /// Serializes current ExtendedDataType 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 ExtendedDataType object
        /// </summary>
        /// <param name="fileName">string xml file to load and deserialize</param>
        /// <param name="obj">Output ExtendedDataType 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 ExtendedDataType obj, out System.Exception exception) {
            exception = null;
            obj = default(ExtendedDataType);
            try {
                obj = LoadFromFile(fileName);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool LoadFromFile(string fileName, out ExtendedDataType obj) {
            System.Exception exception = null;
            return LoadFromFile(fileName, out obj, out exception);
        }
        
        public static ExtendedDataType 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 ExtendedDataType object
        /// </summary>
        public virtual ExtendedDataType Clone() {
            return ((ExtendedDataType)(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 RelatePropertyType : System.ComponentModel.INotifyPropertyChanged {
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string featureClassPropertyField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string attributeClassPropertyField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private ExtendedDataType extendedData1Field;
        
        private static System.Xml.Serialization.XmlSerializer serializer;
        
        public string FeatureClassProperty {
            get {
                return this.featureClassPropertyField;
            }
            set {
                if ((this.featureClassPropertyField != null)) {
                    if ((featureClassPropertyField.Equals(value) != true)) {
                        this.featureClassPropertyField = value;
                        this.OnPropertyChanged("FeatureClassProperty");
                    }
                }
                else {
                    this.featureClassPropertyField = value;
                    this.OnPropertyChanged("FeatureClassProperty");
                }
            }
        }
        
        public string AttributeClassProperty {
            get {
                return this.attributeClassPropertyField;
            }
            set {
                if ((this.attributeClassPropertyField != null)) {
                    if ((attributeClassPropertyField.Equals(value) != true)) {
                        this.attributeClassPropertyField = value;
                        this.OnPropertyChanged("AttributeClassProperty");
                    }
                }
                else {
                    this.attributeClassPropertyField = value;
                    this.OnPropertyChanged("AttributeClassProperty");
                }
            }
        }
        
        public ExtendedDataType ExtendedData1 {
            get {
                return this.extendedData1Field;
            }
            set {
                if ((this.extendedData1Field != null)) {
                    if ((extendedData1Field.Equals(value) != true)) {
                        this.extendedData1Field = value;
                        this.OnPropertyChanged("ExtendedData1");
                    }
                }
                else {
                    this.extendedData1Field = value;
                    this.OnPropertyChanged("ExtendedData1");
                }
            }
        }
        
        private static System.Xml.Serialization.XmlSerializer Serializer {
            get {
                if ((serializer == null)) {
                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(RelatePropertyType));
                }
                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 RelatePropertyType 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 RelatePropertyType object
        /// </summary>
        /// <param name="xml">string workflow markup to deserialize</param>
        /// <param name="obj">Output RelatePropertyType 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 RelatePropertyType obj, out System.Exception exception) {
            exception = null;
            obj = default(RelatePropertyType);
            try {
                obj = Deserialize(xml);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool Deserialize(string xml, out RelatePropertyType obj) {
            System.Exception exception = null;
            return Deserialize(xml, out obj, out exception);
        }
        
        public static RelatePropertyType Deserialize(string xml) {
            System.IO.StringReader stringReader = null;
            try {
                stringReader = new System.IO.StringReader(xml);
                return ((RelatePropertyType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
            }
            finally {
                if ((stringReader != null)) {
                    stringReader.Dispose();
                }
            }
        }
        
        /// <summary>
        /// Serializes current RelatePropertyType 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 RelatePropertyType object
        /// </summary>
        /// <param name="fileName">string xml file to load and deserialize</param>
        /// <param name="obj">Output RelatePropertyType 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 RelatePropertyType obj, out System.Exception exception) {
            exception = null;
            obj = default(RelatePropertyType);
            try {
                obj = LoadFromFile(fileName);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool LoadFromFile(string fileName, out RelatePropertyType obj) {
            System.Exception exception = null;
            return LoadFromFile(fileName, out obj, out exception);
        }
        
        public static RelatePropertyType 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 RelatePropertyType object
        /// </summary>
        public virtual RelatePropertyType Clone() {
            return ((RelatePropertyType)(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 AttributeRelateType : System.ComponentModel.INotifyPropertyChanged {
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private BindingList<RelatePropertyType> relatePropertyField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string attributeClassField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string resourceIdField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string nameField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string attributeNameDelimiterField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private RelateTypeEnum relateTypeField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private bool relateTypeFieldSpecified;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private bool forceOneToOneField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private bool forceOneToOneFieldSpecified;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private ExtendedDataType extendedData1Field;
        
        private static System.Xml.Serialization.XmlSerializer serializer;
        
        [System.Xml.Serialization.XmlElementAttribute("RelateProperty")]
        public BindingList<RelatePropertyType> RelateProperty {
            get {
                return this.relatePropertyField;
            }
            set {
                if ((this.relatePropertyField != null)) {
                    if ((relatePropertyField.Equals(value) != true)) {
                        this.relatePropertyField = value;
                        this.OnPropertyChanged("RelateProperty");
                    }
                }
                else {
                    this.relatePropertyField = value;
                    this.OnPropertyChanged("RelateProperty");
                }
            }
        }
        
        public string AttributeClass {
            get {
                return this.attributeClassField;
            }
            set {
                if ((this.attributeClassField != null)) {
                    if ((attributeClassField.Equals(value) != true)) {
                        this.attributeClassField = value;
                        this.OnPropertyChanged("AttributeClass");
                    }
                }
                else {
                    this.attributeClassField = value;
                    this.OnPropertyChanged("AttributeClass");
                }
            }
        }
        
        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 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 AttributeNameDelimiter {
            get {
                return this.attributeNameDelimiterField;
            }
            set {
                if ((this.attributeNameDelimiterField != null)) {
                    if ((attributeNameDelimiterField.Equals(value) != true)) {
                        this.attributeNameDelimiterField = value;
                        this.OnPropertyChanged("AttributeNameDelimiter");
                    }
                }
                else {
                    this.attributeNameDelimiterField = value;
                    this.OnPropertyChanged("AttributeNameDelimiter");
                }
            }
        }
        
        public RelateTypeEnum RelateType {
            get {
                return this.relateTypeField;
            }
            set {
                if ((relateTypeField.Equals(value) != true)) {
                    this.relateTypeField = value;
                    this.OnPropertyChanged("RelateType");
                }
            }
        }
        
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool RelateTypeSpecified {
            get {
                return this.relateTypeFieldSpecified;
            }
            set {
                if ((relateTypeFieldSpecified.Equals(value) != true)) {
                    this.relateTypeFieldSpecified = value;
                    this.OnPropertyChanged("RelateTypeSpecified");
                }
            }
        }
        
        public bool ForceOneToOne {
            get {
                return this.forceOneToOneField;
            }
            set {
                if ((forceOneToOneField.Equals(value) != true)) {
                    this.forceOneToOneField = value;
                    this.ForceOneToOneSpecified = true;
                    this.OnPropertyChanged("ForceOneToOne");
                }
            }
        }
        
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool ForceOneToOneSpecified {
            get {
                return this.forceOneToOneFieldSpecified;
            }
            set {
                if ((forceOneToOneFieldSpecified.Equals(value) != true)) {
                    this.forceOneToOneFieldSpecified = value;
                    this.OnPropertyChanged("ForceOneToOneSpecified");
                }
            }
        }
        
        public ExtendedDataType ExtendedData1 {
            get {
                return this.extendedData1Field;
            }
            set {
                if ((this.extendedData1Field != null)) {
                    if ((extendedData1Field.Equals(value) != true)) {
                        this.extendedData1Field = value;
                        this.OnPropertyChanged("ExtendedData1");
                    }
                }
                else {
                    this.extendedData1Field = value;
                    this.OnPropertyChanged("ExtendedData1");
                }
            }
        }
        
        private static System.Xml.Serialization.XmlSerializer Serializer {
            get {
                if ((serializer == null)) {
                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(AttributeRelateType));
                }
                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 AttributeRelateType 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 AttributeRelateType object
        /// </summary>
        /// <param name="xml">string workflow markup to deserialize</param>
        /// <param name="obj">Output AttributeRelateType 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 AttributeRelateType obj, out System.Exception exception) {
            exception = null;
            obj = default(AttributeRelateType);
            try {
                obj = Deserialize(xml);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool Deserialize(string xml, out AttributeRelateType obj) {
            System.Exception exception = null;
            return Deserialize(xml, out obj, out exception);
        }
        
        public static AttributeRelateType Deserialize(string xml) {
            System.IO.StringReader stringReader = null;
            try {
                stringReader = new System.IO.StringReader(xml);
                return ((AttributeRelateType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
            }
            finally {
                if ((stringReader != null)) {
                    stringReader.Dispose();
                }
            }
        }
        
        /// <summary>
        /// Serializes current AttributeRelateType 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 AttributeRelateType object
        /// </summary>
        /// <param name="fileName">string xml file to load and deserialize</param>
        /// <param name="obj">Output AttributeRelateType 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 AttributeRelateType obj, out System.Exception exception) {
            exception = null;
            obj = default(AttributeRelateType);
            try {
                obj = LoadFromFile(fileName);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool LoadFromFile(string fileName, out AttributeRelateType obj) {
            System.Exception exception = null;
            return LoadFromFile(fileName, out obj, out exception);
        }
        
        public static AttributeRelateType 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 AttributeRelateType object
        /// </summary>
        public virtual AttributeRelateType Clone() {
            return ((AttributeRelateType)(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 CalculatedPropertyType : System.ComponentModel.INotifyPropertyChanged {
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string nameField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string expressionField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private ExtendedDataType extendedData1Field;
        
        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 Expression {
            get {
                return this.expressionField;
            }
            set {
                if ((this.expressionField != null)) {
                    if ((expressionField.Equals(value) != true)) {
                        this.expressionField = value;
                        this.OnPropertyChanged("Expression");
                    }
                }
                else {
                    this.expressionField = value;
                    this.OnPropertyChanged("Expression");
                }
            }
        }
        
        public ExtendedDataType ExtendedData1 {
            get {
                return this.extendedData1Field;
            }
            set {
                if ((this.extendedData1Field != null)) {
                    if ((extendedData1Field.Equals(value) != true)) {
                        this.extendedData1Field = value;
                        this.OnPropertyChanged("ExtendedData1");
                    }
                }
                else {
                    this.extendedData1Field = value;
                    this.OnPropertyChanged("ExtendedData1");
                }
            }
        }
        
        private static System.Xml.Serialization.XmlSerializer Serializer {
            get {
                if ((serializer == null)) {
                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(CalculatedPropertyType));
                }
                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 CalculatedPropertyType 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 CalculatedPropertyType object
        /// </summary>
        /// <param name="xml">string workflow markup to deserialize</param>
        /// <param name="obj">Output CalculatedPropertyType 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 CalculatedPropertyType obj, out System.Exception exception) {
            exception = null;
            obj = default(CalculatedPropertyType);
            try {
                obj = Deserialize(xml);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool Deserialize(string xml, out CalculatedPropertyType obj) {
            System.Exception exception = null;
            return Deserialize(xml, out obj, out exception);
        }
        
        public static CalculatedPropertyType Deserialize(string xml) {
            System.IO.StringReader stringReader = null;
            try {
                stringReader = new System.IO.StringReader(xml);
                return ((CalculatedPropertyType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
            }
            finally {
                if ((stringReader != null)) {
                    stringReader.Dispose();
                }
            }
        }
        
        /// <summary>
        /// Serializes current CalculatedPropertyType 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 CalculatedPropertyType object
        /// </summary>
        /// <param name="fileName">string xml file to load and deserialize</param>
        /// <param name="obj">Output CalculatedPropertyType 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 CalculatedPropertyType obj, out System.Exception exception) {
            exception = null;
            obj = default(CalculatedPropertyType);
            try {
                obj = LoadFromFile(fileName);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool LoadFromFile(string fileName, out CalculatedPropertyType obj) {
            System.Exception exception = null;
            return LoadFromFile(fileName, out obj, out exception);
        }
        
        public static CalculatedPropertyType 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 CalculatedPropertyType object
        /// </summary>
        public virtual CalculatedPropertyType Clone() {
            return ((CalculatedPropertyType)(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 SpatialContextType : System.ComponentModel.INotifyPropertyChanged {
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string nameField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string coordinateSystemField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private ExtendedDataType extendedData1Field;
        
        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 ExtendedDataType ExtendedData1 {
            get {
                return this.extendedData1Field;
            }
            set {
                if ((this.extendedData1Field != null)) {
                    if ((extendedData1Field.Equals(value) != true)) {
                        this.extendedData1Field = value;
                        this.OnPropertyChanged("ExtendedData1");
                    }
                }
                else {
                    this.extendedData1Field = value;
                    this.OnPropertyChanged("ExtendedData1");
                }
            }
        }
        
        private static System.Xml.Serialization.XmlSerializer Serializer {
            get {
                if ((serializer == null)) {
                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(SpatialContextType));
                }
                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 SpatialContextType 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 SpatialContextType object
        /// </summary>
        /// <param name="xml">string workflow markup to deserialize</param>
        /// <param name="obj">Output SpatialContextType 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 SpatialContextType obj, out System.Exception exception) {
            exception = null;
            obj = default(SpatialContextType);
            try {
                obj = Deserialize(xml);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool Deserialize(string xml, out SpatialContextType obj) {
            System.Exception exception = null;
            return Deserialize(xml, out obj, out exception);
        }
        
        public static SpatialContextType Deserialize(string xml) {
            System.IO.StringReader stringReader = null;
            try {
                stringReader = new System.IO.StringReader(xml);
                return ((SpatialContextType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
            }
            finally {
                if ((stringReader != null)) {
                    stringReader.Dispose();
                }
            }
        }
        
        /// <summary>
        /// Serializes current SpatialContextType 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 SpatialContextType object
        /// </summary>
        /// <param name="fileName">string xml file to load and deserialize</param>
        /// <param name="obj">Output SpatialContextType 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 SpatialContextType obj, out System.Exception exception) {
            exception = null;
            obj = default(SpatialContextType);
            try {
                obj = LoadFromFile(fileName);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool LoadFromFile(string fileName, out SpatialContextType obj) {
            System.Exception exception = null;
            return LoadFromFile(fileName, out obj, out exception);
        }
        
        public static SpatialContextType 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 SpatialContextType object
        /// </summary>
        public virtual SpatialContextType Clone() {
            return ((SpatialContextType)(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 FeatureSourceTypeExtension : System.ComponentModel.INotifyPropertyChanged {
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private BindingList<CalculatedPropertyType> calculatedPropertyField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private BindingList<AttributeRelateType> attributeRelateField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string nameField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private string featureClassField;
        
        [EditorBrowsable(EditorBrowsableState.Never)]
        private ExtendedDataType extendedData1Field;
        
        private static System.Xml.Serialization.XmlSerializer serializer;
        
        [System.Xml.Serialization.XmlElementAttribute("CalculatedProperty")]
        public BindingList<CalculatedPropertyType> CalculatedProperty {
            get {
                return this.calculatedPropertyField;
            }
            set {
                if ((this.calculatedPropertyField != null)) {
                    if ((calculatedPropertyField.Equals(value) != true)) {
                        this.calculatedPropertyField = value;
                        this.OnPropertyChanged("CalculatedProperty");
                    }
                }
                else {
                    this.calculatedPropertyField = value;
                    this.OnPropertyChanged("CalculatedProperty");
                }
            }
        }
        
        [System.Xml.Serialization.XmlElementAttribute("AttributeRelate")]
        public BindingList<AttributeRelateType> AttributeRelate {
            get {
                return this.attributeRelateField;
            }
            set {
                if ((this.attributeRelateField != null)) {
                    if ((attributeRelateField.Equals(value) != true)) {
                        this.attributeRelateField = value;
                        this.OnPropertyChanged("AttributeRelate");
                    }
                }
                else {
                    this.attributeRelateField = value;
                    this.OnPropertyChanged("AttributeRelate");
                }
            }
        }
        
        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 FeatureClass {
            get {
                return this.featureClassField;
            }
            set {
                if ((this.featureClassField != null)) {
                    if ((featureClassField.Equals(value) != true)) {
                        this.featureClassField = value;
                        this.OnPropertyChanged("FeatureClass");
                    }
                }
                else {
                    this.featureClassField = value;
                    this.OnPropertyChanged("FeatureClass");
                }
            }
        }
        
        public ExtendedDataType ExtendedData1 {
            get {
                return this.extendedData1Field;
            }
            set {
                if ((this.extendedData1Field != null)) {
                    if ((extendedData1Field.Equals(value) != true)) {
                        this.extendedData1Field = value;
                        this.OnPropertyChanged("ExtendedData1");
                    }
                }
                else {
                    this.extendedData1Field = value;
                    this.OnPropertyChanged("ExtendedData1");
                }
            }
        }
        
        private static System.Xml.Serialization.XmlSerializer Serializer {
            get {
                if ((serializer == null)) {
                    serializer = new System.Xml.Serialization.XmlSerializer(typeof(FeatureSourceTypeExtension));
                }
                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 FeatureSourceTypeExtension 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 FeatureSourceTypeExtension object
        /// </summary>
        /// <param name="xml">string workflow markup to deserialize</param>
        /// <param name="obj">Output FeatureSourceTypeExtension 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 FeatureSourceTypeExtension obj, out System.Exception exception) {
            exception = null;
            obj = default(FeatureSourceTypeExtension);
            try {
                obj = Deserialize(xml);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool Deserialize(string xml, out FeatureSourceTypeExtension obj) {
            System.Exception exception = null;
            return Deserialize(xml, out obj, out exception);
        }
        
        public static FeatureSourceTypeExtension Deserialize(string xml) {
            System.IO.StringReader stringReader = null;
            try {
                stringReader = new System.IO.StringReader(xml);
                return ((FeatureSourceTypeExtension)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
            }
            finally {
                if ((stringReader != null)) {
                    stringReader.Dispose();
                }
            }
        }
        
        /// <summary>
        /// Serializes current FeatureSourceTypeExtension 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 FeatureSourceTypeExtension object
        /// </summary>
        /// <param name="fileName">string xml file to load and deserialize</param>
        /// <param name="obj">Output FeatureSourceTypeExtension 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 FeatureSourceTypeExtension obj, out System.Exception exception) {
            exception = null;
            obj = default(FeatureSourceTypeExtension);
            try {
                obj = LoadFromFile(fileName);
                return true;
            }
            catch (System.Exception ex) {
                exception = ex;
                return false;
            }
        }
        
        public static bool LoadFromFile(string fileName, out FeatureSourceTypeExtension obj) {
            System.Exception exception = null;
            return LoadFromFile(fileName, out obj, out exception);
        }
        
        public static FeatureSourceTypeExtension 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 FeatureSourceTypeExtension object
        /// </summary>
        public virtual FeatureSourceTypeExtension Clone() {
            return ((FeatureSourceTypeExtension)(this.MemberwiseClone()));
        }
        #endregion
    }
}