//------------------------------------------------------------------------------
// <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 UserSettings : DataSet {
        
        private UsersDataTable tableUsers;
        
        private UserFormsDataTable tableUserForms;
        
        private DataRelation relationRelation1;
        
        public UserSettings() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected UserSettings(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["Users"] != null)) {
                    this.Tables.Add(new UsersDataTable(ds.Tables["Users"]));
                }
                if ((ds.Tables["UserForms"] != null)) {
                    this.Tables.Add(new UserFormsDataTable(ds.Tables["UserForms"]));
                }
                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 UsersDataTable Users {
            get {
                return this.tableUsers;
            }
        }
        
        [System.ComponentModel.Browsable(false)]
        [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
        public UserFormsDataTable UserForms {
            get {
                return this.tableUserForms;
            }
        }
        
        public override DataSet Clone() {
            UserSettings cln = ((UserSettings)(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["Users"] != null)) {
                this.Tables.Add(new UsersDataTable(ds.Tables["Users"]));
            }
            if ((ds.Tables["UserForms"] != null)) {
                this.Tables.Add(new UserFormsDataTable(ds.Tables["UserForms"]));
            }
            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.tableUsers = ((UsersDataTable)(this.Tables["Users"]));
            if ((this.tableUsers != null)) {
                this.tableUsers.InitVars();
            }
            this.tableUserForms = ((UserFormsDataTable)(this.Tables["UserForms"]));
            if ((this.tableUserForms != null)) {
                this.tableUserForms.InitVars();
            }
            this.relationRelation1 = this.Relations["Relation1"];
        }
        
        private void InitClass() {
            this.DataSetName = "Settings";
            this.Prefix = "";
            this.Namespace = "";
            this.Locale = new System.Globalization.CultureInfo("en-US");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.tableUsers = new UsersDataTable();
            this.Tables.Add(this.tableUsers);
            this.tableUserForms = new UserFormsDataTable();
            this.Tables.Add(this.tableUserForms);
            ForeignKeyConstraint fkc;
            fkc = new ForeignKeyConstraint("Relation1", new DataColumn[] {
                        this.tableUsers.UserColumn}, new DataColumn[] {
                        this.tableUserForms.UserColumn});
            this.tableUserForms.Constraints.Add(fkc);
            fkc.AcceptRejectRule = System.Data.AcceptRejectRule.None;
            fkc.DeleteRule = System.Data.Rule.Cascade;
            fkc.UpdateRule = System.Data.Rule.Cascade;
            this.relationRelation1 = new DataRelation("Relation1", new DataColumn[] {
                        this.tableUsers.UserColumn}, new DataColumn[] {
                        this.tableUserForms.UserColumn}, false);
            this.Relations.Add(this.relationRelation1);
        }
        
        private bool ShouldSerializeUsers() {
            return false;
        }
        
        private bool ShouldSerializeUserForms() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void UsersRowChangeEventHandler(object sender, UsersRowChangeEvent e);
        
        public delegate void UserFormsRowChangeEventHandler(object sender, UserFormsRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class UsersDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnUser;
            
            internal UsersDataTable() : 
                    base("Users") {
                this.InitClass();
            }
            
            internal UsersDataTable(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 UserColumn {
                get {
                    return this.columnUser;
                }
            }
            
            public UsersRow this[int index] {
                get {
                    return ((UsersRow)(this.Rows[index]));
                }
            }
            
            public event UsersRowChangeEventHandler UsersRowChanged;
            
            public event UsersRowChangeEventHandler UsersRowChanging;
            
            public event UsersRowChangeEventHandler UsersRowDeleted;
            
            public event UsersRowChangeEventHandler UsersRowDeleting;
            
            public void AddUsersRow(UsersRow row) {
                this.Rows.Add(row);
            }
            
            public UsersRow AddUsersRow(string User) {
                UsersRow rowUsersRow = ((UsersRow)(this.NewRow()));
                rowUsersRow.ItemArray = new object[] {
                        User};
                this.Rows.Add(rowUsersRow);
                return rowUsersRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                UsersDataTable cln = ((UsersDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new UsersDataTable();
            }
            
            internal void InitVars() {
                this.columnUser = this.Columns["User"];
            }
            
            private void InitClass() {
                this.columnUser = new DataColumn("User", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnUser);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnUser}, false));
                this.columnUser.Unique = true;
            }
            
            public UsersRow NewUsersRow() {
                return ((UsersRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new UsersRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(UsersRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.UsersRowChanged != null)) {
                    this.UsersRowChanged(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.UsersRowChanging != null)) {
                    this.UsersRowChanging(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.UsersRowDeleted != null)) {
                    this.UsersRowDeleted(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.UsersRowDeleting != null)) {
                    this.UsersRowDeleting(this, new UsersRowChangeEvent(((UsersRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveUsersRow(UsersRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class UsersRow : DataRow {
            
            private UsersDataTable tableUsers;
            
            internal UsersRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableUsers = ((UsersDataTable)(this.Table));
            }
            
            public string User {
                get {
                    try {
                        return ((string)(this[this.tableUsers.UserColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableUsers.UserColumn] = value;
                }
            }
            
            public bool IsUserNull() {
                return this.IsNull(this.tableUsers.UserColumn);
            }
            
            public void SetUserNull() {
                this[this.tableUsers.UserColumn] = System.Convert.DBNull;
            }
            
            public UserFormsRow[] GetUserFormsRows() {
                return ((UserFormsRow[])(this.GetChildRows(this.Table.ChildRelations["Relation1"])));
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class UsersRowChangeEvent : EventArgs {
            
            private UsersRow eventRow;
            
            private DataRowAction eventAction;
            
            public UsersRowChangeEvent(UsersRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public UsersRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class UserFormsDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnUser;
            
            private DataColumn columnForm;
            
            private DataColumn columnTop;
            
            private DataColumn columnLeft;
            
            private DataColumn columnHeight;
            
            private DataColumn columnWidth;
            
            private DataColumn columnTag;
            
            internal UserFormsDataTable() : 
                    base("UserForms") {
                this.InitClass();
            }
            
            internal UserFormsDataTable(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 UserColumn {
                get {
                    return this.columnUser;
                }
            }
            
            internal DataColumn FormColumn {
                get {
                    return this.columnForm;
                }
            }
            
            internal DataColumn TopColumn {
                get {
                    return this.columnTop;
                }
            }
            
            internal DataColumn LeftColumn {
                get {
                    return this.columnLeft;
                }
            }
            
            internal DataColumn HeightColumn {
                get {
                    return this.columnHeight;
                }
            }
            
            internal DataColumn WidthColumn {
                get {
                    return this.columnWidth;
                }
            }
            
            internal DataColumn TagColumn {
                get {
                    return this.columnTag;
                }
            }
            
            public UserFormsRow this[int index] {
                get {
                    return ((UserFormsRow)(this.Rows[index]));
                }
            }
            
            public event UserFormsRowChangeEventHandler UserFormsRowChanged;
            
            public event UserFormsRowChangeEventHandler UserFormsRowChanging;
            
            public event UserFormsRowChangeEventHandler UserFormsRowDeleted;
            
            public event UserFormsRowChangeEventHandler UserFormsRowDeleting;
            
            public void AddUserFormsRow(UserFormsRow row) {
                this.Rows.Add(row);
            }
            
            public UserFormsRow AddUserFormsRow(UsersRow parentUsersRowByRelation1, string Form, string Top, string Left, string Height, string Width, string Tag) {
                UserFormsRow rowUserFormsRow = ((UserFormsRow)(this.NewRow()));
                rowUserFormsRow.ItemArray = new object[] {
                        parentUsersRowByRelation1[0],
                        Form,
                        Top,
                        Left,
                        Height,
                        Width,
                        Tag};
                this.Rows.Add(rowUserFormsRow);
                return rowUserFormsRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                UserFormsDataTable cln = ((UserFormsDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new UserFormsDataTable();
            }
            
            internal void InitVars() {
                this.columnUser = this.Columns["User"];
                this.columnForm = this.Columns["Form"];
                this.columnTop = this.Columns["Top"];
                this.columnLeft = this.Columns["Left"];
                this.columnHeight = this.Columns["Height"];
                this.columnWidth = this.Columns["Width"];
                this.columnTag = this.Columns["Tag"];
            }
            
            private void InitClass() {
                this.columnUser = new DataColumn("User", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnUser);
                this.columnForm = new DataColumn("Form", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnForm);
                this.columnTop = new DataColumn("Top", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnTop);
                this.columnLeft = new DataColumn("Left", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnLeft);
                this.columnHeight = new DataColumn("Height", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnHeight);
                this.columnWidth = new DataColumn("Width", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnWidth);
                this.columnTag = new DataColumn("Tag", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnTag);
            }
            
            public UserFormsRow NewUserFormsRow() {
                return ((UserFormsRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new UserFormsRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(UserFormsRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.UserFormsRowChanged != null)) {
                    this.UserFormsRowChanged(this, new UserFormsRowChangeEvent(((UserFormsRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.UserFormsRowChanging != null)) {
                    this.UserFormsRowChanging(this, new UserFormsRowChangeEvent(((UserFormsRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.UserFormsRowDeleted != null)) {
                    this.UserFormsRowDeleted(this, new UserFormsRowChangeEvent(((UserFormsRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.UserFormsRowDeleting != null)) {
                    this.UserFormsRowDeleting(this, new UserFormsRowChangeEvent(((UserFormsRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveUserFormsRow(UserFormsRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class UserFormsRow : DataRow {
            
            private UserFormsDataTable tableUserForms;
            
            internal UserFormsRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableUserForms = ((UserFormsDataTable)(this.Table));
            }
            
            public string User {
                get {
                    try {
                        return ((string)(this[this.tableUserForms.UserColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableUserForms.UserColumn] = value;
                }
            }
            
            public string Form {
                get {
                    try {
                        return ((string)(this[this.tableUserForms.FormColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableUserForms.FormColumn] = value;
                }
            }
            
            public string Top {
                get {
                    try {
                        return ((string)(this[this.tableUserForms.TopColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableUserForms.TopColumn] = value;
                }
            }
            
            public string Left {
                get {
                    try {
                        return ((string)(this[this.tableUserForms.LeftColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableUserForms.LeftColumn] = value;
                }
            }
            
            public string Height {
                get {
                    try {
                        return ((string)(this[this.tableUserForms.HeightColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableUserForms.HeightColumn] = value;
                }
            }
            
            public string Width {
                get {
                    try {
                        return ((string)(this[this.tableUserForms.WidthColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableUserForms.WidthColumn] = value;
                }
            }
            
            public string Tag {
                get {
                    try {
                        return ((string)(this[this.tableUserForms.TagColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableUserForms.TagColumn] = value;
                }
            }
            
            public UsersRow UsersRow {
                get {
                    return ((UsersRow)(this.GetParentRow(this.Table.ParentRelations["Relation1"])));
                }
                set {
                    this.SetParentRow(value, this.Table.ParentRelations["Relation1"]);
                }
            }
            
            public bool IsUserNull() {
                return this.IsNull(this.tableUserForms.UserColumn);
            }
            
            public void SetUserNull() {
                this[this.tableUserForms.UserColumn] = System.Convert.DBNull;
            }
            
            public bool IsFormNull() {
                return this.IsNull(this.tableUserForms.FormColumn);
            }
            
            public void SetFormNull() {
                this[this.tableUserForms.FormColumn] = System.Convert.DBNull;
            }
            
            public bool IsTopNull() {
                return this.IsNull(this.tableUserForms.TopColumn);
            }
            
            public void SetTopNull() {
                this[this.tableUserForms.TopColumn] = System.Convert.DBNull;
            }
            
            public bool IsLeftNull() {
                return this.IsNull(this.tableUserForms.LeftColumn);
            }
            
            public void SetLeftNull() {
                this[this.tableUserForms.LeftColumn] = System.Convert.DBNull;
            }
            
            public bool IsHeightNull() {
                return this.IsNull(this.tableUserForms.HeightColumn);
            }
            
            public void SetHeightNull() {
                this[this.tableUserForms.HeightColumn] = System.Convert.DBNull;
            }
            
            public bool IsWidthNull() {
                return this.IsNull(this.tableUserForms.WidthColumn);
            }
            
            public void SetWidthNull() {
                this[this.tableUserForms.WidthColumn] = System.Convert.DBNull;
            }
            
            public bool IsTagNull() {
                return this.IsNull(this.tableUserForms.TagColumn);
            }
            
            public void SetTagNull() {
                this[this.tableUserForms.TagColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class UserFormsRowChangeEvent : EventArgs {
            
            private UserFormsRow eventRow;
            
            private DataRowAction eventAction;
            
            public UserFormsRowChangeEvent(UserFormsRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public UserFormsRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
