static void Main(string[] args) { int[] alarmtable = new int[] { 10, 20, 30, 40, -1 }; clock clock = new clock(0, alarmtable); clock.start(); }
static void Main(string[] args) { clock clock = new clock(); subscribEvent sub = new subscribEvent(); sub.HandleTick(clock); while (clock.now < clock.obj) { System.Threading.Thread.Sleep(1000); clock.raiseChanged(); } sub.HandleAlarm(clock); clock.raiseAlarm(); }
public void HandleAlarm(clock clock) { clock.Alarm += new clock.AlarmEventHandler(afterAlarm); }
public void HandleTick(clock clock) { clock.Tick += new clock.AlarmEventHandler(clocktick); }