Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Clock c = new Clock();

            c.Switch();
            //c.setTime();
            Console.WriteLine("请设定闹钟时间:(XX时XX分)");
            int hour = Convert.ToInt32(Console.ReadLine());
            int min  = Convert.ToInt32(Console.ReadLine());

            Time.TargetTime.set(hour, min, 0);

            Time.Tick  += new ClockTick(c.TickFunc);
            Time.alarm += new ClockAlarm(c.AlarmFunc);

            while (true)
            {
                if (Time.shutdown)
                {
                    break;
                }
                Time.checkTick();
            }
            Console.ReadKey();
        }