//------------------------------------------------------------------------------
// <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 LocalHost : DataSet {
        
        private CommPortSettingsDataTable tableCommPortSettings;
        
        public LocalHost() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected LocalHost(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["CommPortSettings"] != null)) {
                    this.Tables.Add(new CommPortSettingsDataTable(ds.Tables["CommPortSettings"]));
                }
                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 CommPortSettingsDataTable CommPortSettings {
            get {
                return this.tableCommPortSettings;
            }
        }
        
        public override DataSet Clone() {
            LocalHost cln = ((LocalHost)(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["CommPortSettings"] != null)) {
                this.Tables.Add(new CommPortSettingsDataTable(ds.Tables["CommPortSettings"]));
            }
            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.tableCommPortSettings = ((CommPortSettingsDataTable)(this.Tables["CommPortSettings"]));
            if ((this.tableCommPortSettings != null)) {
                this.tableCommPortSettings.InitVars();
            }
        }
        
        private void InitClass() {
            this.DataSetName = "LocalHost";
            this.Prefix = "";
            this.Namespace = "";
            this.Locale = new System.Globalization.CultureInfo("en-US");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.tableCommPortSettings = new CommPortSettingsDataTable();
            this.Tables.Add(this.tableCommPortSettings);
        }
        
        private bool ShouldSerializeCommPortSettings() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void CommPortSettingsRowChangeEventHandler(object sender, CommPortSettingsRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CommPortSettingsDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnCommPort;
            
            private DataColumn columnBaudRate;
            
            private DataColumn columnHandShake;
            
            private DataColumn columnStopBit;
            
            private DataColumn columnDataBit;
            
            private DataColumn columnParity;
            
            internal CommPortSettingsDataTable() : 
                    base("CommPortSettings") {
                this.InitClass();
            }
            
            internal CommPortSettingsDataTable(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 CommPortColumn {
                get {
                    return this.columnCommPort;
                }
            }
            
            internal DataColumn BaudRateColumn {
                get {
                    return this.columnBaudRate;
                }
            }
            
            internal DataColumn HandShakeColumn {
                get {
                    return this.columnHandShake;
                }
            }
            
            internal DataColumn StopBitColumn {
                get {
                    return this.columnStopBit;
                }
            }
            
            internal DataColumn DataBitColumn {
                get {
                    return this.columnDataBit;
                }
            }
            
            internal DataColumn ParityColumn {
                get {
                    return this.columnParity;
                }
            }
            
            public CommPortSettingsRow this[int index] {
                get {
                    return ((CommPortSettingsRow)(this.Rows[index]));
                }
            }
            
            public event CommPortSettingsRowChangeEventHandler CommPortSettingsRowChanged;
            
            public event CommPortSettingsRowChangeEventHandler CommPortSettingsRowChanging;
            
            public event CommPortSettingsRowChangeEventHandler CommPortSettingsRowDeleted;
            
            public event CommPortSettingsRowChangeEventHandler CommPortSettingsRowDeleting;
            
            public void AddCommPortSettingsRow(CommPortSettingsRow row) {
                this.Rows.Add(row);
            }
            
            public CommPortSettingsRow AddCommPortSettingsRow(string CommPort, string BaudRate, string HandShake, string StopBit, string DataBit, string Parity) {
                CommPortSettingsRow rowCommPortSettingsRow = ((CommPortSettingsRow)(this.NewRow()));
                rowCommPortSettingsRow.ItemArray = new object[] {
                        CommPort,
                        BaudRate,
                        HandShake,
                        StopBit,
                        DataBit,
                        Parity};
                this.Rows.Add(rowCommPortSettingsRow);
                return rowCommPortSettingsRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                CommPortSettingsDataTable cln = ((CommPortSettingsDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new CommPortSettingsDataTable();
            }
            
            internal void InitVars() {
                this.columnCommPort = this.Columns["CommPort"];
                this.columnBaudRate = this.Columns["BaudRate"];
                this.columnHandShake = this.Columns["HandShake"];
                this.columnStopBit = this.Columns["StopBit"];
                this.columnDataBit = this.Columns["DataBit"];
                this.columnParity = this.Columns["Parity"];
            }
            
            private void InitClass() {
                this.columnCommPort = new DataColumn("CommPort", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCommPort);
                this.columnBaudRate = new DataColumn("BaudRate", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnBaudRate);
                this.columnHandShake = new DataColumn("HandShake", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnHandShake);
                this.columnStopBit = new DataColumn("StopBit", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnStopBit);
                this.columnDataBit = new DataColumn("DataBit", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnDataBit);
                this.columnParity = new DataColumn("Parity", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnParity);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnCommPort}, false));
                this.columnCommPort.Unique = true;
            }
            
            public CommPortSettingsRow NewCommPortSettingsRow() {
                return ((CommPortSettingsRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new CommPortSettingsRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(CommPortSettingsRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.CommPortSettingsRowChanged != null)) {
                    this.CommPortSettingsRowChanged(this, new CommPortSettingsRowChangeEvent(((CommPortSettingsRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.CommPortSettingsRowChanging != null)) {
                    this.CommPortSettingsRowChanging(this, new CommPortSettingsRowChangeEvent(((CommPortSettingsRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.CommPortSettingsRowDeleted != null)) {
                    this.CommPortSettingsRowDeleted(this, new CommPortSettingsRowChangeEvent(((CommPortSettingsRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.CommPortSettingsRowDeleting != null)) {
                    this.CommPortSettingsRowDeleting(this, new CommPortSettingsRowChangeEvent(((CommPortSettingsRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveCommPortSettingsRow(CommPortSettingsRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CommPortSettingsRow : DataRow {
            
            private CommPortSettingsDataTable tableCommPortSettings;
            
            internal CommPortSettingsRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableCommPortSettings = ((CommPortSettingsDataTable)(this.Table));
            }
            
            public string CommPort {
                get {
                    try {
                        return ((string)(this[this.tableCommPortSettings.CommPortColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableCommPortSettings.CommPortColumn] = value;
                }
            }
            
            public string BaudRate {
                get {
                    try {
                        return ((string)(this[this.tableCommPortSettings.BaudRateColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableCommPortSettings.BaudRateColumn] = value;
                }
            }
            
            public string HandShake {
                get {
                    try {
                        return ((string)(this[this.tableCommPortSettings.HandShakeColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableCommPortSettings.HandShakeColumn] = value;
                }
            }
            
            public string StopBit {
                get {
                    try {
                        return ((string)(this[this.tableCommPortSettings.StopBitColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableCommPortSettings.StopBitColumn] = value;
                }
            }
            
            public string DataBit {
                get {
                    try {
                        return ((string)(this[this.tableCommPortSettings.DataBitColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableCommPortSettings.DataBitColumn] = value;
                }
            }
            
            public string Parity {
                get {
                    try {
                        return ((string)(this[this.tableCommPortSettings.ParityColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableCommPortSettings.ParityColumn] = value;
                }
            }
            
            public bool IsCommPortNull() {
                return this.IsNull(this.tableCommPortSettings.CommPortColumn);
            }
            
            public void SetCommPortNull() {
                this[this.tableCommPortSettings.CommPortColumn] = System.Convert.DBNull;
            }
            
            public bool IsBaudRateNull() {
                return this.IsNull(this.tableCommPortSettings.BaudRateColumn);
            }
            
            public void SetBaudRateNull() {
                this[this.tableCommPortSettings.BaudRateColumn] = System.Convert.DBNull;
            }
            
            public bool IsHandShakeNull() {
                return this.IsNull(this.tableCommPortSettings.HandShakeColumn);
            }
            
            public void SetHandShakeNull() {
                this[this.tableCommPortSettings.HandShakeColumn] = System.Convert.DBNull;
            }
            
            public bool IsStopBitNull() {
                return this.IsNull(this.tableCommPortSettings.StopBitColumn);
            }
            
            public void SetStopBitNull() {
                this[this.tableCommPortSettings.StopBitColumn] = System.Convert.DBNull;
            }
            
            public bool IsDataBitNull() {
                return this.IsNull(this.tableCommPortSettings.DataBitColumn);
            }
            
            public void SetDataBitNull() {
                this[this.tableCommPortSettings.DataBitColumn] = System.Convert.DBNull;
            }
            
            public bool IsParityNull() {
                return this.IsNull(this.tableCommPortSettings.ParityColumn);
            }
            
            public void SetParityNull() {
                this[this.tableCommPortSettings.ParityColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CommPortSettingsRowChangeEvent : EventArgs {
            
            private CommPortSettingsRow eventRow;
            
            private DataRowAction eventAction;
            
            public CommPortSettingsRowChangeEvent(CommPortSettingsRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public CommPortSettingsRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
