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

namespace DowReplayManager.NET.Types {
    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 CategoryStore : DataSet {
        
        private CategoryDataTable tableCategory;
        
        public CategoryStore() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected CategoryStore(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["Category"] != null)) {
                    this.Tables.Add(new CategoryDataTable(ds.Tables["Category"]));
                }
                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 CategoryDataTable Category {
            get {
                return this.tableCategory;
            }
        }
        
        public override DataSet Clone() {
            CategoryStore cln = ((CategoryStore)(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["Category"] != null)) {
                this.Tables.Add(new CategoryDataTable(ds.Tables["Category"]));
            }
            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.tableCategory = ((CategoryDataTable)(this.Tables["Category"]));
            if ((this.tableCategory != null)) {
                this.tableCategory.InitVars();
            }
        }
        
        private void InitClass() {
            this.DataSetName = "CategoryStore";
            this.Prefix = "";
            this.Namespace = "http://tempuri.org/CategoryStore.xsd";
            this.Locale = new System.Globalization.CultureInfo("en-ZA");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.tableCategory = new CategoryDataTable();
            this.Tables.Add(this.tableCategory);
        }
        
        private bool ShouldSerializeCategory() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void CategoryRowChangeEventHandler(object sender, CategoryRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CategoryDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnID;
            
            private DataColumn columnName;
            
            private DataColumn columnAllowDelete;
            
            private DataColumn columnParentID;
            
            private DataColumn columnHasChildren;
            
            internal CategoryDataTable() : 
                    base("Category") {
                this.InitClass();
            }
            
            internal CategoryDataTable(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 IDColumn {
                get {
                    return this.columnID;
                }
            }
            
            internal DataColumn NameColumn {
                get {
                    return this.columnName;
                }
            }
            
            internal DataColumn AllowDeleteColumn {
                get {
                    return this.columnAllowDelete;
                }
            }
            
            internal DataColumn ParentIDColumn {
                get {
                    return this.columnParentID;
                }
            }
            
            internal DataColumn HasChildrenColumn {
                get {
                    return this.columnHasChildren;
                }
            }
            
            public CategoryRow this[int index] {
                get {
                    return ((CategoryRow)(this.Rows[index]));
                }
            }
            
            public event CategoryRowChangeEventHandler CategoryRowChanged;
            
            public event CategoryRowChangeEventHandler CategoryRowChanging;
            
            public event CategoryRowChangeEventHandler CategoryRowDeleted;
            
            public event CategoryRowChangeEventHandler CategoryRowDeleting;
            
            public void AddCategoryRow(CategoryRow row) {
                this.Rows.Add(row);
            }
            
            public CategoryRow AddCategoryRow(string Name, bool AllowDelete, int ParentID, bool HasChildren) {
                CategoryRow rowCategoryRow = ((CategoryRow)(this.NewRow()));
                rowCategoryRow.ItemArray = new object[] {
                        null,
                        Name,
                        AllowDelete,
                        ParentID,
                        HasChildren};
                this.Rows.Add(rowCategoryRow);
                return rowCategoryRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                CategoryDataTable cln = ((CategoryDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new CategoryDataTable();
            }
            
            internal void InitVars() {
                this.columnID = this.Columns["ID"];
                this.columnName = this.Columns["Name"];
                this.columnAllowDelete = this.Columns["AllowDelete"];
                this.columnParentID = this.Columns["ParentID"];
                this.columnHasChildren = this.Columns["HasChildren"];
            }
            
            private void InitClass() {
                this.columnID = new DataColumn("ID", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnID);
                this.columnName = new DataColumn("Name", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnName);
                this.columnAllowDelete = new DataColumn("AllowDelete", typeof(bool), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnAllowDelete);
                this.columnParentID = new DataColumn("ParentID", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnParentID);
                this.columnHasChildren = new DataColumn("HasChildren", typeof(bool), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnHasChildren);
                this.columnID.AutoIncrement = true;
                this.columnID.AutoIncrementSeed = 1;
                this.columnID.AllowDBNull = false;
                this.columnName.AllowDBNull = false;
                this.columnAllowDelete.AllowDBNull = false;
                this.columnParentID.AllowDBNull = false;
                this.columnHasChildren.AllowDBNull = false;
            }
            
            public CategoryRow NewCategoryRow() {
                return ((CategoryRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new CategoryRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(CategoryRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.CategoryRowChanged != null)) {
                    this.CategoryRowChanged(this, new CategoryRowChangeEvent(((CategoryRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.CategoryRowChanging != null)) {
                    this.CategoryRowChanging(this, new CategoryRowChangeEvent(((CategoryRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.CategoryRowDeleted != null)) {
                    this.CategoryRowDeleted(this, new CategoryRowChangeEvent(((CategoryRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.CategoryRowDeleting != null)) {
                    this.CategoryRowDeleting(this, new CategoryRowChangeEvent(((CategoryRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveCategoryRow(CategoryRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CategoryRow : DataRow {
            
            private CategoryDataTable tableCategory;
            
            internal CategoryRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableCategory = ((CategoryDataTable)(this.Table));
            }
            
            public int ID {
                get {
                    return ((int)(this[this.tableCategory.IDColumn]));
                }
                set {
                    this[this.tableCategory.IDColumn] = value;
                }
            }
            
            public string Name {
                get {
                    return ((string)(this[this.tableCategory.NameColumn]));
                }
                set {
                    this[this.tableCategory.NameColumn] = value;
                }
            }
            
            public bool AllowDelete {
                get {
                    return ((bool)(this[this.tableCategory.AllowDeleteColumn]));
                }
                set {
                    this[this.tableCategory.AllowDeleteColumn] = value;
                }
            }
            
            public int ParentID {
                get {
                    return ((int)(this[this.tableCategory.ParentIDColumn]));
                }
                set {
                    this[this.tableCategory.ParentIDColumn] = value;
                }
            }
            
            public bool HasChildren {
                get {
                    return ((bool)(this[this.tableCategory.HasChildrenColumn]));
                }
                set {
                    this[this.tableCategory.HasChildrenColumn] = value;
                }
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CategoryRowChangeEvent : EventArgs {
            
            private CategoryRow eventRow;
            
            private DataRowAction eventAction;
            
            public CategoryRowChangeEvent(CategoryRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public CategoryRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
