Esempio n. 1
0
        //4.
        public void Tick(int hour, int min, int sec)
        {
            Console.WriteLine($"Clock is ticking to {hour}:{min}:{sec}");
            TickEventArgs args = new TickEventArgs()
            {
                Hour = hour,
                Min  = min,
                Sec  = sec
            };

            //触发Ticking事件
            Ticking(this, args);
        }
Esempio n. 2
0
 //6.
 void Clock_IsTicking(object sender, TickEventArgs args)
 {
     Console.WriteLine($"Clock is ticking!");
 }