/// <summary> /// 测试委托 /// </summary> public static void TestDelegate() { var w = new Watch(); var alarm = new Alarm(); var alarmBtn = new AlarmButton(); w.ReachTime += alarm.Belling; w.ReachTime += alarmBtn.Press; w.Work(); }
public Watch() { this.alarm = new Alarm(); this.alarmButton = new AlarmButton(); }