摘要:
1 public class Complex 2 { 3 int _real; 4 int _imag; 5 public Complex(int i1, int i2) 6 { 7 _real = i1; 8 _imag = i2; 9 } 10 11 public int real 12 ... 阅读全文
摘要:
委托链有一个特性: 就是所有加入的委托, 都会在激活时按照加入的次序被执行. 下面看用委托实现的NET事件模型 public class Calculator{ //定义计算器事件CalculateEventArgs public class CalculateEventArgs:EventArgs { //只读数据变量 public readonly Int32 x... 阅读全文
摘要:
public class PropertyDemo { private int _property1; public int Property1 { get { return _property1; } set { _property1=value;//value是一个C#默认支持的值,专门用于设置属性 } }... 阅读全文