摘要: 委托要声明和注册事件其中第一类方法包括两个方法 一般是类型差不多的方法用来实现委托的功能 主要是注册事件此为第一类方法heater.Boiled += Display.ShowMsg; heater.Boiled += alarm.MakeAlert;第二类方法调用委托的方法要先理解为什么要用委托,就是因为有个方法要不停的调用“不同的方法”----委托,才有了委托, protected virtual void OnBolied(BoiledEventArgs e) { if (Boiled != null) { //如果有对象注册 Boiled(this, e); //调用所... 阅读全文
posted @ 2012-06-11 00:52 haiziguo 阅读(180) 评论(0) 推荐(0) 编辑