예제 #1
0
        public void Alarm()
        {
            ClockEventArgs args = new ClockEventArgs()
            {
                alarmingTime = DateTime.Now
            };

            AlarmEvent(this, args);
        }
예제 #2
0
        public void Tick()
        {
            Thread.Sleep(1000);
            ClockEventArgs args = new ClockEventArgs()
            {
                tickingTime = DateTime.Now
            };

            TickEvent(this, args);
        }
예제 #3
0
 static void AlarmListener(object sender, ClockEventArgs args)
 {
     Console.WriteLine("响铃啦!当前时间:" + args.alarmingTime);
 }
예제 #4
0
 static void TickListener(object sender, ClockEventArgs args)
 {
     Console.WriteLine("秒针摆动!当前时间:" + args.tickingTime);
 }