//------------------------------------------------------------------------------
// <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 Tutorial8 {
    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 DsContacts : DataSet {
        
        private ContactsDataTable tableContacts;
        
        public DsContacts() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected DsContacts(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["Contacts"] != null)) {
                    this.Tables.Add(new ContactsDataTable(ds.Tables["Contacts"]));
                }
                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 ContactsDataTable Contacts {
            get {
                return this.tableContacts;
            }
        }
        
        public override DataSet Clone() {
            DsContacts cln = ((DsContacts)(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["Contacts"] != null)) {
                this.Tables.Add(new ContactsDataTable(ds.Tables["Contacts"]));
            }
            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.tableContacts = ((ContactsDataTable)(this.Tables["Contacts"]));
            if ((this.tableContacts != null)) {
                this.tableContacts.InitVars();
            }
        }
        
        private void InitClass() {
            this.DataSetName = "DsContacts";
            this.Prefix = "";
            this.Namespace = "http://www.tempuri.org/DsContacts.xsd";
            this.Locale = new System.Globalization.CultureInfo("en-US");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.tableContacts = new ContactsDataTable();
            this.Tables.Add(this.tableContacts);
        }
        
        private bool ShouldSerializeContacts() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void ContactsRowChangeEventHandler(object sender, ContactsRowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ContactsDataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnCallback;
            
            private DataColumn columnComments;
            
            private DataColumn columnContactDate;
            
            private DataColumn columnContactType;
            
            private DataColumn columnUserCode;
            
            private DataColumn columnCompany;
            
            private DataColumn columnContacted;
            
            private DataColumn columnCustType;
            
            private DataColumn columnFirstName;
            
            private DataColumn columnLastName;
            
            private DataColumn columnPhone;
            
            private DataColumn columnExpr1;
            
            internal ContactsDataTable() : 
                    base("Contacts") {
                this.InitClass();
            }
            
            internal ContactsDataTable(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 CallbackColumn {
                get {
                    return this.columnCallback;
                }
            }
            
            internal DataColumn CommentsColumn {
                get {
                    return this.columnComments;
                }
            }
            
            internal DataColumn ContactDateColumn {
                get {
                    return this.columnContactDate;
                }
            }
            
            internal DataColumn ContactTypeColumn {
                get {
                    return this.columnContactType;
                }
            }
            
            internal DataColumn UserCodeColumn {
                get {
                    return this.columnUserCode;
                }
            }
            
            internal DataColumn CompanyColumn {
                get {
                    return this.columnCompany;
                }
            }
            
            internal DataColumn ContactedColumn {
                get {
                    return this.columnContacted;
                }
            }
            
            internal DataColumn CustTypeColumn {
                get {
                    return this.columnCustType;
                }
            }
            
            internal DataColumn FirstNameColumn {
                get {
                    return this.columnFirstName;
                }
            }
            
            internal DataColumn LastNameColumn {
                get {
                    return this.columnLastName;
                }
            }
            
            internal DataColumn PhoneColumn {
                get {
                    return this.columnPhone;
                }
            }
            
            internal DataColumn Expr1Column {
                get {
                    return this.columnExpr1;
                }
            }
            
            public ContactsRow this[int index] {
                get {
                    return ((ContactsRow)(this.Rows[index]));
                }
            }
            
            public event ContactsRowChangeEventHandler ContactsRowChanged;
            
            public event ContactsRowChangeEventHandler ContactsRowChanging;
            
            public event ContactsRowChangeEventHandler ContactsRowDeleted;
            
            public event ContactsRowChangeEventHandler ContactsRowDeleting;
            
            public void AddContactsRow(ContactsRow row) {
                this.Rows.Add(row);
            }
            
            public ContactsRow AddContactsRow(bool Callback, string Comments, System.DateTime ContactDate, short ContactType, string UserCode, string Company, System.DateTime Contacted, short CustType, string FirstName, string LastName, System.Double Phone, string Expr1) {
                ContactsRow rowContactsRow = ((ContactsRow)(this.NewRow()));
                rowContactsRow.ItemArray = new object[] {
                        Callback,
                        Comments,
                        ContactDate,
                        ContactType,
                        UserCode,
                        Company,
                        Contacted,
                        CustType,
                        FirstName,
                        LastName,
                        Phone,
                        Expr1};
                this.Rows.Add(rowContactsRow);
                return rowContactsRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                ContactsDataTable cln = ((ContactsDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new ContactsDataTable();
            }
            
            internal void InitVars() {
                this.columnCallback = this.Columns["Callback"];
                this.columnComments = this.Columns["Comments"];
                this.columnContactDate = this.Columns["ContactDate"];
                this.columnContactType = this.Columns["ContactType"];
                this.columnUserCode = this.Columns["UserCode"];
                this.columnCompany = this.Columns["Company"];
                this.columnContacted = this.Columns["Contacted"];
                this.columnCustType = this.Columns["CustType"];
                this.columnFirstName = this.Columns["FirstName"];
                this.columnLastName = this.Columns["LastName"];
                this.columnPhone = this.Columns["Phone"];
                this.columnExpr1 = this.Columns["Expr1"];
            }
            
            private void InitClass() {
                this.columnCallback = new DataColumn("Callback", typeof(bool), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCallback);
                this.columnComments = new DataColumn("Comments", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnComments);
                this.columnContactDate = new DataColumn("ContactDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnContactDate);
                this.columnContactType = new DataColumn("ContactType", typeof(short), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnContactType);
                this.columnUserCode = new DataColumn("UserCode", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnUserCode);
                this.columnCompany = new DataColumn("Company", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCompany);
                this.columnContacted = new DataColumn("Contacted", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnContacted);
                this.columnCustType = new DataColumn("CustType", typeof(short), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCustType);
                this.columnFirstName = new DataColumn("FirstName", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnFirstName);
                this.columnLastName = new DataColumn("LastName", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnLastName);
                this.columnPhone = new DataColumn("Phone", typeof(System.Double), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnPhone);
                this.columnExpr1 = new DataColumn("Expr1", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnExpr1);
            }
            
            public ContactsRow NewContactsRow() {
                return ((ContactsRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new ContactsRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(ContactsRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.ContactsRowChanged != null)) {
                    this.ContactsRowChanged(this, new ContactsRowChangeEvent(((ContactsRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.ContactsRowChanging != null)) {
                    this.ContactsRowChanging(this, new ContactsRowChangeEvent(((ContactsRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.ContactsRowDeleted != null)) {
                    this.ContactsRowDeleted(this, new ContactsRowChangeEvent(((ContactsRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.ContactsRowDeleting != null)) {
                    this.ContactsRowDeleting(this, new ContactsRowChangeEvent(((ContactsRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveContactsRow(ContactsRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ContactsRow : DataRow {
            
            private ContactsDataTable tableContacts;
            
            internal ContactsRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableContacts = ((ContactsDataTable)(this.Table));
            }
            
            public bool Callback {
                get {
                    try {
                        return ((bool)(this[this.tableContacts.CallbackColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.CallbackColumn] = value;
                }
            }
            
            public string Comments {
                get {
                    try {
                        return ((string)(this[this.tableContacts.CommentsColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.CommentsColumn] = value;
                }
            }
            
            public System.DateTime ContactDate {
                get {
                    try {
                        return ((System.DateTime)(this[this.tableContacts.ContactDateColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.ContactDateColumn] = value;
                }
            }
            
            public short ContactType {
                get {
                    try {
                        return ((short)(this[this.tableContacts.ContactTypeColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.ContactTypeColumn] = value;
                }
            }
            
            public string UserCode {
                get {
                    try {
                        return ((string)(this[this.tableContacts.UserCodeColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.UserCodeColumn] = value;
                }
            }
            
            public string Company {
                get {
                    try {
                        return ((string)(this[this.tableContacts.CompanyColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.CompanyColumn] = value;
                }
            }
            
            public System.DateTime Contacted {
                get {
                    try {
                        return ((System.DateTime)(this[this.tableContacts.ContactedColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.ContactedColumn] = value;
                }
            }
            
            public short CustType {
                get {
                    try {
                        return ((short)(this[this.tableContacts.CustTypeColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.CustTypeColumn] = value;
                }
            }
            
            public string FirstName {
                get {
                    try {
                        return ((string)(this[this.tableContacts.FirstNameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.FirstNameColumn] = value;
                }
            }
            
            public string LastName {
                get {
                    try {
                        return ((string)(this[this.tableContacts.LastNameColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.LastNameColumn] = value;
                }
            }
            
            public System.Double Phone {
                get {
                    try {
                        return ((System.Double)(this[this.tableContacts.PhoneColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.PhoneColumn] = value;
                }
            }
            
            public string Expr1 {
                get {
                    try {
                        return ((string)(this[this.tableContacts.Expr1Column]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("Cannot get value because it is DBNull.", e);
                    }
                }
                set {
                    this[this.tableContacts.Expr1Column] = value;
                }
            }
            
            public bool IsCallbackNull() {
                return this.IsNull(this.tableContacts.CallbackColumn);
            }
            
            public void SetCallbackNull() {
                this[this.tableContacts.CallbackColumn] = System.Convert.DBNull;
            }
            
            public bool IsCommentsNull() {
                return this.IsNull(this.tableContacts.CommentsColumn);
            }
            
            public void SetCommentsNull() {
                this[this.tableContacts.CommentsColumn] = System.Convert.DBNull;
            }
            
            public bool IsContactDateNull() {
                return this.IsNull(this.tableContacts.ContactDateColumn);
            }
            
            public void SetContactDateNull() {
                this[this.tableContacts.ContactDateColumn] = System.Convert.DBNull;
            }
            
            public bool IsContactTypeNull() {
                return this.IsNull(this.tableContacts.ContactTypeColumn);
            }
            
            public void SetContactTypeNull() {
                this[this.tableContacts.ContactTypeColumn] = System.Convert.DBNull;
            }
            
            public bool IsUserCodeNull() {
                return this.IsNull(this.tableContacts.UserCodeColumn);
            }
            
            public void SetUserCodeNull() {
                this[this.tableContacts.UserCodeColumn] = System.Convert.DBNull;
            }
            
            public bool IsCompanyNull() {
                return this.IsNull(this.tableContacts.CompanyColumn);
            }
            
            public void SetCompanyNull() {
                this[this.tableContacts.CompanyColumn] = System.Convert.DBNull;
            }
            
            public bool IsContactedNull() {
                return this.IsNull(this.tableContacts.ContactedColumn);
            }
            
            public void SetContactedNull() {
                this[this.tableContacts.ContactedColumn] = System.Convert.DBNull;
            }
            
            public bool IsCustTypeNull() {
                return this.IsNull(this.tableContacts.CustTypeColumn);
            }
            
            public void SetCustTypeNull() {
                this[this.tableContacts.CustTypeColumn] = System.Convert.DBNull;
            }
            
            public bool IsFirstNameNull() {
                return this.IsNull(this.tableContacts.FirstNameColumn);
            }
            
            public void SetFirstNameNull() {
                this[this.tableContacts.FirstNameColumn] = System.Convert.DBNull;
            }
            
            public bool IsLastNameNull() {
                return this.IsNull(this.tableContacts.LastNameColumn);
            }
            
            public void SetLastNameNull() {
                this[this.tableContacts.LastNameColumn] = System.Convert.DBNull;
            }
            
            public bool IsPhoneNull() {
                return this.IsNull(this.tableContacts.PhoneColumn);
            }
            
            public void SetPhoneNull() {
                this[this.tableContacts.PhoneColumn] = System.Convert.DBNull;
            }
            
            public bool IsExpr1Null() {
                return this.IsNull(this.tableContacts.Expr1Column);
            }
            
            public void SetExpr1Null() {
                this[this.tableContacts.Expr1Column] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class ContactsRowChangeEvent : EventArgs {
            
            private ContactsRow eventRow;
            
            private DataRowAction eventAction;
            
            public ContactsRowChangeEvent(ContactsRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public ContactsRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
