⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 域名.cs

📁 该源代码用 C# 写成
💻 CS
📖 第 1 页 / 共 2 页
字号:
            
            public event DomainRowChangeEventHandler DomainRowDeleted;
            
            public event DomainRowChangeEventHandler DomainRowDeleting;
            
            public void AddDomainRow(DomainRow row) {
                this.Rows.Add(row);
            }
            
            public DomainRow AddDomainRow(string EnDescription, string CnDescription, string Abbrev) {
                DomainRow rowDomainRow = ((DomainRow)(this.NewRow()));
                rowDomainRow.ItemArray = new object[] {
                        EnDescription,
                        CnDescription,
                        Abbrev};
                this.Rows.Add(rowDomainRow);
                return rowDomainRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                DomainDataTable cln = ((DomainDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new DomainDataTable();
            }
            
            internal void InitVars() {
                this.columnEnDescription = this.Columns["EnDescription"];
                this.columnCnDescription = this.Columns["CnDescription"];
                this.columnAbbrev = this.Columns["Abbrev"];
            }
            
            private void InitClass() {
                this.columnEnDescription = new DataColumn("EnDescription", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnEnDescription);
                this.columnCnDescription = new DataColumn("CnDescription", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnCnDescription);
                this.columnAbbrev = new DataColumn("Abbrev", typeof(string), null, System.Data.MappingType.Attribute);
                this.Columns.Add(this.columnAbbrev);
                this.columnAbbrev.Namespace = "";
            }
            
            public DomainRow NewDomainRow() {
                return ((DomainRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new DomainRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(DomainRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.DomainRowChanged != null)) {
                    this.DomainRowChanged(this, new DomainRowChangeEvent(((DomainRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.DomainRowChanging != null)) {
                    this.DomainRowChanging(this, new DomainRowChangeEvent(((DomainRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.DomainRowDeleted != null)) {
                    this.DomainRowDeleted(this, new DomainRowChangeEvent(((DomainRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.DomainRowDeleting != null)) {
                    this.DomainRowDeleting(this, new DomainRowChangeEvent(((DomainRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveDomainRow(DomainRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class DomainRow : DataRow {
            
            private DomainDataTable tableDomain;
            
            internal DomainRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableDomain = ((DomainDataTable)(this.Table));
            }
            
            public string EnDescription {
                get {
                    try {
                        return ((string)(this[this.tableDomain.EnDescriptionColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableDomain.EnDescriptionColumn] = value;
                }
            }
            
            public string CnDescription {
                get {
                    try {
                        return ((string)(this[this.tableDomain.CnDescriptionColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableDomain.CnDescriptionColumn] = value;
                }
            }
            
            public string Abbrev {
                get {
                    try {
                        return ((string)(this[this.tableDomain.AbbrevColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableDomain.AbbrevColumn] = value;
                }
            }
            
            public bool IsEnDescriptionNull() {
                return this.IsNull(this.tableDomain.EnDescriptionColumn);
            }
            
            public void SetEnDescriptionNull() {
                this[this.tableDomain.EnDescriptionColumn] = System.Convert.DBNull;
            }
            
            public bool IsCnDescriptionNull() {
                return this.IsNull(this.tableDomain.CnDescriptionColumn);
            }
            
            public void SetCnDescriptionNull() {
                this[this.tableDomain.CnDescriptionColumn] = System.Convert.DBNull;
            }
            
            public bool IsAbbrevNull() {
                return this.IsNull(this.tableDomain.AbbrevColumn);
            }
            
            public void SetAbbrevNull() {
                this[this.tableDomain.AbbrevColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class DomainRowChangeEvent : EventArgs {
            
            private DomainRow eventRow;
            
            private DataRowAction eventAction;
            
            public DomainRowChangeEvent(DomainRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public DomainRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -