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

📄 货币.cs

📁 该源代码用 C# 写成
💻 CS
📖 第 1 页 / 共 2 页
字号:
            
            public event CurrencyRowChangeEventHandler CurrencyRowDeleted;
            
            public event CurrencyRowChangeEventHandler CurrencyRowDeleting;
            
            public void AddCurrencyRow(CurrencyRow row) {
                this.Rows.Add(row);
            }
            
            public CurrencyRow AddCurrencyRow(string Unit, string SmallUnit, string Country) {
                CurrencyRow rowCurrencyRow = ((CurrencyRow)(this.NewRow()));
                rowCurrencyRow.ItemArray = new object[] {
                        Unit,
                        SmallUnit,
                        Country};
                this.Rows.Add(rowCurrencyRow);
                return rowCurrencyRow;
            }
            
            public System.Collections.IEnumerator GetEnumerator() {
                return this.Rows.GetEnumerator();
            }
            
            public override DataTable Clone() {
                CurrencyDataTable cln = ((CurrencyDataTable)(base.Clone()));
                cln.InitVars();
                return cln;
            }
            
            protected override DataTable CreateInstance() {
                return new CurrencyDataTable();
            }
            
            internal void InitVars() {
                this.columnUnit = this.Columns["Unit"];
                this.columnSmallUnit = this.Columns["SmallUnit"];
                this.columnCountry = this.Columns["Country"];
            }
            
            private void InitClass() {
                this.columnUnit = new DataColumn("Unit", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnUnit);
                this.columnSmallUnit = new DataColumn("SmallUnit", typeof(string), null, System.Data.MappingType.Element);
                this.Columns.Add(this.columnSmallUnit);
                this.columnCountry = new DataColumn("Country", typeof(string), null, System.Data.MappingType.Attribute);
                this.Columns.Add(this.columnCountry);
                this.columnCountry.Namespace = "";
            }
            
            public CurrencyRow NewCurrencyRow() {
                return ((CurrencyRow)(this.NewRow()));
            }
            
            protected override DataRow NewRowFromBuilder(DataRowBuilder builder) {
                return new CurrencyRow(builder);
            }
            
            protected override System.Type GetRowType() {
                return typeof(CurrencyRow);
            }
            
            protected override void OnRowChanged(DataRowChangeEventArgs e) {
                base.OnRowChanged(e);
                if ((this.CurrencyRowChanged != null)) {
                    this.CurrencyRowChanged(this, new CurrencyRowChangeEvent(((CurrencyRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowChanging(DataRowChangeEventArgs e) {
                base.OnRowChanging(e);
                if ((this.CurrencyRowChanging != null)) {
                    this.CurrencyRowChanging(this, new CurrencyRowChangeEvent(((CurrencyRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleted(DataRowChangeEventArgs e) {
                base.OnRowDeleted(e);
                if ((this.CurrencyRowDeleted != null)) {
                    this.CurrencyRowDeleted(this, new CurrencyRowChangeEvent(((CurrencyRow)(e.Row)), e.Action));
                }
            }
            
            protected override void OnRowDeleting(DataRowChangeEventArgs e) {
                base.OnRowDeleting(e);
                if ((this.CurrencyRowDeleting != null)) {
                    this.CurrencyRowDeleting(this, new CurrencyRowChangeEvent(((CurrencyRow)(e.Row)), e.Action));
                }
            }
            
            public void RemoveCurrencyRow(CurrencyRow row) {
                this.Rows.Remove(row);
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CurrencyRow : DataRow {
            
            private CurrencyDataTable tableCurrency;
            
            internal CurrencyRow(DataRowBuilder rb) : 
                    base(rb) {
                this.tableCurrency = ((CurrencyDataTable)(this.Table));
            }
            
            public string Unit {
                get {
                    try {
                        return ((string)(this[this.tableCurrency.UnitColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableCurrency.UnitColumn] = value;
                }
            }
            
            public string SmallUnit {
                get {
                    try {
                        return ((string)(this[this.tableCurrency.SmallUnitColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableCurrency.SmallUnitColumn] = value;
                }
            }
            
            public string Country {
                get {
                    try {
                        return ((string)(this[this.tableCurrency.CountryColumn]));
                    }
                    catch (InvalidCastException e) {
                        throw new StrongTypingException("无法获取值,因为它是 DBNull。", e);
                    }
                }
                set {
                    this[this.tableCurrency.CountryColumn] = value;
                }
            }
            
            public bool IsUnitNull() {
                return this.IsNull(this.tableCurrency.UnitColumn);
            }
            
            public void SetUnitNull() {
                this[this.tableCurrency.UnitColumn] = System.Convert.DBNull;
            }
            
            public bool IsSmallUnitNull() {
                return this.IsNull(this.tableCurrency.SmallUnitColumn);
            }
            
            public void SetSmallUnitNull() {
                this[this.tableCurrency.SmallUnitColumn] = System.Convert.DBNull;
            }
            
            public bool IsCountryNull() {
                return this.IsNull(this.tableCurrency.CountryColumn);
            }
            
            public void SetCountryNull() {
                this[this.tableCurrency.CountryColumn] = System.Convert.DBNull;
            }
        }
        
        [System.Diagnostics.DebuggerStepThrough()]
        public class CurrencyRowChangeEvent : EventArgs {
            
            private CurrencyRow eventRow;
            
            private DataRowAction eventAction;
            
            public CurrencyRowChangeEvent(CurrencyRow row, DataRowAction action) {
                this.eventRow = row;
                this.eventAction = action;
            }
            
            public CurrencyRow Row {
                get {
                    return this.eventRow;
                }
            }
            
            public DataRowAction Action {
                get {
                    return this.eventAction;
                }
            }
        }
    }
}

⌨️ 快捷键说明

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