Ejemplo n.º 1
0
        public void Ring(int hour, int min, int sec)
        {
            AlarmClockArgs args = new AlarmClockArgs();

            args.Hour = hour;
            args.Min  = min;
            args.Sec  = sec;
            while (args.Hour != DateTime.Now.Hour || args.Min != DateTime.Now.Minute || args.Sec != DateTime.Now.Second)
            {
                System.Threading.Thread.Sleep(0);
            }
            TimeOut(this, args);
        }
Ejemplo n.º 2
0
 static void clock_Alarmclock(object sender, AlarmClockArgs args)
 {
     Console.WriteLine("Time out!");
 }