//------------------------------------------------------------------------------
// <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>
//------------------------------------------------------------------------------

namespace BookCommunityService {
    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 DataSetMessage : DataSet {
        
        private MESSAGE_INFODataTable tableMESSAGE_INFO;
        
        public DataSetMessage() {
            this.InitClass();
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler;
            this.Relations.CollectionChanged += schemaChangedHandler;
        }
        
        protected DataSetMessage(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["MESSAGE_INFO"] != null)) {
                    this.Tables.Add(new MESSAGE_INFODataTable(ds.Tables["MESSAGE_INFO"]));
                }
                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 MESSAGE_INFODataTable MESSAGE_INFO {
            get {
                return this.tableMESSAGE_INFO;
            }
        }
        
        public override DataSet Clone() {
            DataSetMessage cln = ((DataSetMessage)(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["MESSAGE_INFO"] != null)) {
                this.Tables.Add(new MESSAGE_INFODataTable(ds.Tables["MESSAGE_INFO"]));
            }
            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.tableMESSAGE_INFO = ((MESSAGE_INFODataTable)(this.Tables["MESSAGE_INFO"]));
            if ((this.tableMESSAGE_INFO != null)) {
                this.tableMESSAGE_INFO.InitVars();
            }
        }
        
        private void InitClass() {
            this.DataSetName = "DataSetMessage";
            this.Prefix = "";
            this.Namespace = "http://www.tempuri.org/DataSetMessage.xsd";
            this.Locale = new System.Globalization.CultureInfo("zh-CN");
            this.CaseSensitive = false;
            this.EnforceConstraints = true;
            this.tableMESSAGE_INFO = new MESSAGE_INFODataTable();
            this.Tables.Add(this.tableMESSAGE_INFO);
        }
        
        private bool ShouldSerializeMESSAGE_INFO() {
            return false;
        }
        
        private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
            if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
                this.InitVars();
            }
        }
        
        public delegate void MESSAGE_INFORowChangeEventHandler(object sender, MESSAGE_INFORowChangeEvent e);
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class MESSAGE_INFODataTable : DataTable, System.Collections.IEnumerable {
            
            private DataColumn columnID;
            
            private DataColumn columnMessageType;
            
            private DataColumn columnMessageTo;
            
            private DataColumn columnMessageFrom;
            
            private DataColumn columnTitle;
            
            private DataColumn columnBody;
            
            private DataColumn columnHasRead;
            
            private DataColumn columnSendDate;
            
            private DataColumn columnShareInfo;
            
            internal MESSAGE_INFODataTable() : 
                    base("MESSAGE_INFO") {
                this.InitClass();
            }
            
            internal MESSAGE_INFODataTable(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 MessageTypeColumn {
                get {
                    return this.columnMessageType;
                }
            }
            
            internal DataColumn MessageToColumn {
                get {
                    return this.columnMessageTo;
                }
            }
            
            internal DataColumn MessageFromColumn {
                get {
                    return this.columnMessageFrom;
                }
            }
            
            internal DataColumn TitleColumn {
                get {
                    return this.columnTitle;
                }
            }
            
            internal DataColumn BodyColumn {
                get {
                    return this.columnBody;
                }
            }
            
            internal DataColumn HasReadColumn {
                get {
                    return this.columnHasRead;
                }
            }
            
            internal DataColumn SendDateColumn {
                get {
                    return this.columnSendDate;
                }
            }
            
            internal DataColumn ShareInfoColumn {
                get {
                    return this.columnShareInfo;
                }
            }
            
            public MESSAGE_INFORow this[int index] {
                get {
                    return ((MESSAGE_INFORow)(this.Rows[index]));
                }
            }
            
            public event MESSAGE_INFORowChangeEventHandler MESSAGE_INFORowChanged;
            
            public event MESSAGE_INFORowChangeEventHandler MESSAGE_INFORowChanging;
            
            public event MESSAGE_INFORowChangeEventHandler MESSAGE_INFORowDeleted;
            
            public event MESSAGE_INFORowChangeEventHandler MESSAGE_INFORowDeleting;
            
            public void AddMESSAGE_INFORow(MESSAGE_INFORow row) {
                this.Rows.Add(row);
            }
            
            public MESSAGE_INFORow AddMESSAGE_INFORow(string MessageType, int MessageTo, int MessageFrom, string Title, string Body, int HasRead, System.DateTime SendDate, int ShareInfo) {
                MESSAGE_INFORow rowMESSAGE_INFORow = ((MESSAGE_INFORow)(this.NewRow()));
                rowMESSAGE_INFORow.ItemArray = new object[] {
                        null,
                        MessageType,
                        MessageTo,
                        MessageFrom,
                        Title,
                        Body,
                        HasRead,
                        SendDate,
                        ShareInfo};
                this.Rows.Add(rowMESSAGE_INFORow);
                return rowMESSAGE_INFORow;
            }
            
            public MESSAGE_INFORow FindByID(int ID) {
                return ((MESSAGE_INFORow)(this.Rows.Find(new object[] {
                            ID})));
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                MESSAGE_INFODataTable cln = ((MESSAGE_INFODataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new MESSAGE_INFODataTable();
            }
            
            internal void InitVars() {
                this.columnID = this.Columns["ID"];
                this.columnMessageType = this.Columns["MessageType"];
                this.columnMessageTo = this.Columns["MessageTo"];
                this.columnMessageFrom = this.Columns["MessageFrom"];
                this.columnTitle = this.Columns["Title"];
                this.columnBody = this.Columns["Body"];
                this.columnHasRead = this.Columns["HasRead"];
                this.columnSendDate = this.Columns["SendDate"];
                this.columnShareInfo = this.Columns["ShareInfo"];
            }
            
            private void InitClass() {
                this.columnID = new DataColumn("ID", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnID);
                this.columnMessageType = new DataColumn("MessageType", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnMessageType);
                this.columnMessageTo = new DataColumn("MessageTo", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnMessageTo);
                this.columnMessageFrom = new DataColumn("MessageFrom", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnMessageFrom);
                this.columnTitle = new DataColumn("Title", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnTitle);
                this.columnBody = new DataColumn("Body", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnBody);
                this.columnHasRead = new DataColumn("HasRead", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnHasRead);
                this.columnSendDate = new DataColumn("SendDate", typeof(System.DateTime), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnSendDate);
                this.columnShareInfo = new DataColumn("ShareInfo", typeof(int), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnShareInfo);
                this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {
                                this.columnID}, true));
                this.columnID.AutoIncrement = true;
                this.columnID.AllowDBNull = false;
                this.columnID.ReadOnly = true;
                this.columnID.Unique = true;
                this.columnSendDate.AllowDBNull = false;
            }
            
            public MESSAGE_INFORow NewMESSAGE_INFORow() {
                return ((MESSAGE_INFORow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new MESSAGE_INFORow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(MESSAGE_INFORow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.MESSAGE_INFORowChanged != null)) {
                    this.MESSAGE_INFORowChanged(this, new MESSAGE_INFORowChangeEvent(((MESSAGE_INFORow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.MESSAGE_INFORowChanging != null)) {
                    this.MESSAGE_INFORowChanging(this, new MESSAGE_INFORowChangeEvent(((MESSAGE_INFORow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.MESSAGE_INFORowDeleted != null)) {
                    this.MESSAGE_INFORowDeleted(this, new MESSAGE_INFORowChangeEvent(((MESSAGE_INFORow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.MESSAGE_INFORowDeleting != null)) {
                    this.MESSAGE_INFORowDeleting(this, new MESSAGE_INFORowChangeEvent(((MESSAGE_INFORow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveMESSAGE_INFORow(MESSAGE_INFORow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class MESSAGE_INFORow : DataRow {
            
            private MESSAGE_INFODataTable tableMESSAGE_INFO;
            
            internal MESSAGE_INFORow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableMESSAGE_INFO = ((MESSAGE_INFODataTable)(this.Table));
            }
            
            public int ID {
                get {
                    return ((int)(this[this.tableMESSAGE_INFO.IDColumn]));
                }
                set {
                    this[this.tableMESSAGE_INFO.IDColumn] = value;
                }
            }
            
            public string MessageType {
                get {
                    try {
                        return ((string)(this[this.tableMESSAGE_INFO.MessageTypeColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值，因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableMESSAGE_INFO.MessageTypeColumn] = value;
                }
            }
            
            public int MessageTo {
                get {
                    try {
                        return ((int)(this[this.tableMESSAGE_INFO.MessageToColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值，因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableMESSAGE_INFO.MessageToColumn] = value;
                }
            }
            
            public int MessageFrom {
                get {
                    try {
                        return ((int)(this[this.tableMESSAGE_INFO.MessageFromColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值，因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableMESSAGE_INFO.MessageFromColumn] = value;
                }
            }
            
            public string Title {
                get {
                    try {
                        return ((string)(this[this.tableMESSAGE_INFO.TitleColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值，因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableMESSAGE_INFO.TitleColumn] = value;
                }
            }
            
            public string Body {
                get {
                    try {
                        return ((string)(this[this.tableMESSAGE_INFO.BodyColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值，因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableMESSAGE_INFO.BodyColumn] = value;
                }
            }
            
            public int HasRead {
                get {
                    try {
                        return ((int)(this[this.tableMESSAGE_INFO.HasReadColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值，因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableMESSAGE_INFO.HasReadColumn] = value;
                }
            }
            
            public System.DateTime SendDate {
                get {
                    return ((System.DateTime)(this[this.tableMESSAGE_INFO.SendDateColumn]));
                }
                set {
                    this[this.tableMESSAGE_INFO.SendDateColumn] = value;
                }
            }
            
            public int ShareInfo {
                get {
                    try {
                        return ((int)(this[this.tableMESSAGE_INFO.ShareInfoColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值，因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableMESSAGE_INFO.ShareInfoColumn] = value;
                }
            }
            
            public bool IsMessageTypeNull() {
                return this.IsNull(this.tableMESSAGE_INFO.MessageTypeColumn);
            }
            
            public void SetMessageTypeNull() {
                this[this.tableMESSAGE_INFO.MessageTypeColumn] = System.Convert.DBNull;
            }
            
            public bool IsMessageToNull() {
                return this.IsNull(this.tableMESSAGE_INFO.MessageToColumn);
            }
            
            public void SetMessageToNull() {
                this[this.tableMESSAGE_INFO.MessageToColumn] = System.Convert.DBNull;
            }
            
            public bool IsMessageFromNull() {
                return this.IsNull(this.tableMESSAGE_INFO.MessageFromColumn);
            }
            
            public void SetMessageFromNull() {
                this[this.tableMESSAGE_INFO.MessageFromColumn] = System.Convert.DBNull;
            }
            
            public bool IsTitleNull() {
                return this.IsNull(this.tableMESSAGE_INFO.TitleColumn);
            }
            
            public void SetTitleNull() {
                this[this.tableMESSAGE_INFO.TitleColumn] = System.Convert.DBNull;
            }
            
            public bool IsBodyNull() {
                return this.IsNull(this.tableMESSAGE_INFO.BodyColumn);
            }
            
            public void SetBodyNull() {
                this[this.tableMESSAGE_INFO.BodyColumn] = System.Convert.DBNull;
            }
            
            public bool IsHasReadNull() {
                return this.IsNull(this.tableMESSAGE_INFO.HasReadColumn);
            }
            
            public void SetHasReadNull() {
                this[this.tableMESSAGE_INFO.HasReadColumn] = System.Convert.DBNull;
            }
            
            public bool IsShareInfoNull() {
                return this.IsNull(this.tableMESSAGE_INFO.ShareInfoColumn);
            }
            
            public void SetShareInfoNull() {
                this[this.tableMESSAGE_INFO.ShareInfoColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class MESSAGE_INFORowChangeEvent : EventArgs {
            
            private MESSAGE_INFORow eventRow;
            
            private DataRowAction eventAction;
            
            public MESSAGE_INFORowChangeEvent(MESSAGE_INFORow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public MESSAGE_INFORow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}
