An event can be raised only from the declaration space in which it is declared. Therefore, a class cannot raise events from any other class, even one from which it is derived. 事件只能在它被声明的声明空间(类)中使用.所以不能从任何其他类引发,即使该类是事件所在类的继承类. 那我们如何才可以引发基类中的事件,给个实例大家一
public class Test { public Test(int age) { this.Age=age;//如果这里使用的是this.age=age;那么属性里的判断将不会执行 } private int age; public int Age { get{return age;} set{ ) { age=; }else { age=value; } } } 转载:C# 类构造函数赋值里属性与字段赋值注意项 solomon_Blog