//------------------------------------------------------------------------------
// <autogenerated>
//     This code was generated by a tool.
//     Runtime Version: 1.1.4322.2032
//
//     Changes to this file may cause incorrect behavior and will be lost if 
//     the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by xsd, Version=1.1.4322.2032.
// 
namespace Minntech.Common.Settings {
    using System;
    using System.Data;
    using System.Xml;
    using System.Runtime.Serialization;
    
    
    [Serializable()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Diagnostics.DebuggerStepThrough()]
    [System.ComponentModel.ToolboxItem(true)]
    public class AppSettings : DataSet {
        
        private ApplicationDataTable tableApplication;
        
        public AppSettings() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected AppSettings(SerializationInfo info, StreamingContext context) {
            string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
            if ((strSchema != null)) {
                DataSet ds = new DataSet();
                ds.ReadXmlSchema(new XmlTextReader(new System.IO.StringReader(strSchema)));
                if ((ds.Tables["Application"] != null)) {
                    this.Tables.Add(new ApplicationDataTable(ds.Tables["Application"]));
                }
                this.DataSetName = ds.DataSetName;
                this.Prefix = ds.Prefix;
                this.Namespace = ds.Namespace;
                this.Locale = ds.Locale;
                this.CaseSensitive = ds.CaseSensitive;
                this.EnforceConstraints = ds.EnforceConstraints;
                this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
                this.InitVars();
            }
            else {
                this.InitClass();
            }
            this.GetSerializationData(info, context);
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        [System.ComponentModel.Browsable(false)]
        [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
        public ApplicationDataTable Application {
            get {
                return this.tableApplication;
            }
        }
        
        public override DataSet Clone() {
            AppSettings cln = ((AppSettings)(base.Clone()));
            cln.InitVars();
            return cln;
        }
        
        protected override bool ShouldSerializeTables() {
            return false;
        }
        
        protected override bool ShouldSerializeRelations() {
            return false;
        }
        
        protected override void ReadXmlSerializable(XmlReader reader) {
            this.Reset();
            DataSet ds = new DataSet();
            ds.ReadXml(reader);
            if ((ds.Tables["Application"] != null)) {
                this.Tables.Add(new ApplicationDataTable(ds.Tables["Application"]));
            }
            this.DataSetName = ds.DataSetName;
            this.Prefix = ds.Prefix;
            this.Namespace = ds.Namespace;
            this.Locale = ds.Locale;
            this.CaseSensitive = ds.CaseSensitive;
            this.EnforceConstraints = ds.EnforceConstraints;
            this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
            this.InitVars();
        }
        
        protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() {
            System.IO.MemoryStream stream = new System.IO.MemoryStream();
            this.WriteXmlSchema(new XmlTextWriter(stream, null));
            stream.Position = 0;
            return System.Xml.Schema.XmlSchema.Read(new XmlTextReader(stream), null);
        }
        
        internal void InitVars() {
            this.tableApplication = ((ApplicationDataTable)(this.Tables["Application"]));
            if ((this.tableApplication != null)) {
                this.tableApplication.InitVars();
            }
        }
        
        private void InitClass() {
            this.DataSetName = "AppSettings";
            this.Prefix = "";
            this.Namespace = "";
            this.Locale = new System.Globalization.CultureInfo("en-US");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.tableApplication = new ApplicationDataTable();
            this.Tables.Add(this.tableApplication);
        }
        
        private bool ShouldSerializeApplication() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void ApplicationRowChangeEventHandler(object sender, ApplicationRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ApplicationDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnParseInterval;
            
            private DataColumn columnCommitInterval;
            
            private DataColumn columnLocalHostSettingsPath;
            
            private DataColumn columnDataSource;
            
            internal ApplicationDataTable() : 
                    base("Application") {
                this.InitClass();
            }
            
            internal ApplicationDataTable(DataTable table) : 
                    base(table.TableName) {
                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
                    this.CaseSensitive = table.CaseSensitive;
                }
                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
                    this.Locale = table.Locale;
                }
                if ((table.Namespace != table.DataSet.Namespace)) {
                    this.Namespace = table.Namespace;
                }
                this.Prefix = table.Prefix;
                this.MinimumCapacity = table.MinimumCapacity;
                this.DisplayExpression = table.DisplayExpression;
            }
            
            [System.ComponentModel.Browsable(false)]
            public int Count {
                get {
                    return this.Rows.Count;
                }
            }
            
            internal DataColumn ParseIntervalColumn {
                get {
                    return this.columnParseInterval;
                }
            }
            
            internal DataColumn CommitIntervalColumn {
                get {
                    return this.columnCommitInterval;
                }
            }
            
            internal DataColumn LocalHostSettingsPathColumn {
                get {
                    return this.columnLocalHostSettingsPath;
                }
            }
            
            internal DataColumn DataSourceColumn {
                get {
                    return this.columnDataSource;
                }
            }
            
            public ApplicationRow this[int index] {
                get {
                    return ((ApplicationRow)(this.Rows[index]));
                }
            }
            
            public event ApplicationRowChangeEventHandler ApplicationRowChanged;
            
            public event ApplicationRowChangeEventHandler ApplicationRowChanging;
            
            public event ApplicationRowChangeEventHandler ApplicationRowDeleted;
            
            public event ApplicationRowChangeEventHandler ApplicationRowDeleting;
            
            public void AddApplicationRow(ApplicationRow row) {
                this.Rows.Add(row);
            }
            
            public ApplicationRow AddApplicationRow(string ParseInterval, string CommitInterval, string LocalHostSettingsPath, string DataSource) {
                ApplicationRow rowApplicationRow = ((ApplicationRow)(this.NewRow()));
                rowApplicationRow.ItemArray = new object[] {
                        ParseInterval,
                        CommitInterval,
                        LocalHostSettingsPath,
                        DataSource};
                this.Rows.Add(rowApplicationRow);
                return rowApplicationRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                ApplicationDataTable cln = ((ApplicationDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new ApplicationDataTable();
            }
            
            internal void InitVars() {
                this.columnParseInterval = this.Columns["ParseInterval"];
                this.columnCommitInterval = this.Columns["CommitInterval"];
                this.columnLocalHostSettingsPath = this.Columns["LocalHostSettingsPath"];
                this.columnDataSource = this.Columns["DataSource"];
            }
            
            private void InitClass() {
                this.columnParseInterval = new DataColumn("ParseInterval", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnParseInterval);
                this.columnCommitInterval = new DataColumn("CommitInterval", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCommitInterval);
                this.columnLocalHostSettingsPath = new DataColumn("LocalHostSettingsPath", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnLocalHostSettingsPath);
                this.columnDataSource = new DataColumn("DataSource", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnDataSource);
            }
            
            public ApplicationRow NewApplicationRow() {
                return ((ApplicationRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new ApplicationRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(ApplicationRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.ApplicationRowChanged != null)) {
                    this.ApplicationRowChanged(this, new ApplicationRowChangeEvent(((ApplicationRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.ApplicationRowChanging != null)) {
                    this.ApplicationRowChanging(this, new ApplicationRowChangeEvent(((ApplicationRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.ApplicationRowDeleted != null)) {
                    this.ApplicationRowDeleted(this, new ApplicationRowChangeEvent(((ApplicationRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.ApplicationRowDeleting != null)) {
                    this.ApplicationRowDeleting(this, new ApplicationRowChangeEvent(((ApplicationRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveApplicationRow(ApplicationRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ApplicationRow : DataRow {
            
            private ApplicationDataTable tableApplication;
            
            internal ApplicationRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableApplication = ((ApplicationDataTable)(this.Table));
            }
            
            public string ParseInterval {
                get {
                    try {
                        return ((string)(this[this.tableApplication.ParseIntervalColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableApplication.ParseIntervalColumn] = value;
                }
            }
            
            public string CommitInterval {
                get {
                    try {
                        return ((string)(this[this.tableApplication.CommitIntervalColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableApplication.CommitIntervalColumn] = value;
                }
            }
            
            public string LocalHostSettingsPath {
                get {
                    try {
                        return ((string)(this[this.tableApplication.LocalHostSettingsPathColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableApplication.LocalHostSettingsPathColumn] = value;
                }
            }
            
            public string DataSource {
                get {
                    try {
                        return ((string)(this[this.tableApplication.DataSourceColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableApplication.DataSourceColumn] = value;
                }
            }
            
            public bool IsParseIntervalNull() {
                return this.IsNull(this.tableApplication.ParseIntervalColumn);
            }
            
            public void SetParseIntervalNull() {
                this[this.tableApplication.ParseIntervalColumn] = System.Convert.DBNull;
            }
            
            public bool IsCommitIntervalNull() {
                return this.IsNull(this.tableApplication.CommitIntervalColumn);
            }
            
            public void SetCommitIntervalNull() {
                this[this.tableApplication.CommitIntervalColumn] = System.Convert.DBNull;
            }
            
            public bool IsLocalHostSettingsPathNull() {
                return this.IsNull(this.tableApplication.LocalHostSettingsPathColumn);
            }
            
            public void SetLocalHostSettingsPathNull() {
                this[this.tableApplication.LocalHostSettingsPathColumn] = System.Convert.DBNull;
            }
            
            public bool IsDataSourceNull() {
                return this.IsNull(this.tableApplication.DataSourceColumn);
            }
            
            public void SetDataSourceNull() {
                this[this.tableApplication.DataSourceColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ApplicationRowChangeEvent : EventArgs {
            
            private ApplicationRow eventRow;
            
            private DataRowAction eventAction;
            
            public ApplicationRowChangeEvent(ApplicationRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public ApplicationRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
