随笔分类 - 重构
摘要:1.事件通常写法(C# 1.0)this.button.Click +=new EventHandler(button_Click); void button_Click(object sender, EventArgs e) { throw new NotImplementedException(); } 在C#2.0中使用匿名方法this.button.Click +=delegate{throw new NotImplementedException(); }; //或者 this.button.Click +=delegate(object obj, EventArgs ar...
阅读全文