Ejemplo n.º 1
0
        public void Alarm()
        {
            ClockEventArgs args = new ClockEventArgs()
            {
                alarmingTime = DateTime.Now
            };

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

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