예제 #1
0
        void clock2(Object sender, TickClock args1, AlarmClock args2)
        {
            if (args1.nowTime == args2.alarmTime)
            {
                Console.WriteLine("闹钟响了");
            }

            Thread.Sleep(1000);
        }
예제 #2
0
        //触发事件
        public void onClock()
        {
            TickClock args1 = new TickClock();

            AlarmClock args2 = new AlarmClock("19:56:00");

            TickClock(this, args1);
            AlarmClock(this, args1, args2);
        }
예제 #3
0
 void clock1(Object sender, TickClock args)
 {
     Console.WriteLine("现在时间是:" + args.nowTime);
 }