예제 #1
0
        public void CountDown(int t)
        {
            CountDownTimerEventArgs args = new CountDownTimerEventArgs()
            {
                Countdowntime = t
            };

            CountDownHandler(this, args);
        }
예제 #2
0
 static void CountDown1(object sender, CountDownTimerEventArgs args)
 {
     while (args.Countdowntime > 0)
     {
         Console.WriteLine(args.Countdowntime--);
         Thread.Sleep(1000);
         if (args.Countdowntime == 0)
         {
             Console.WriteLine("Time is up!");
         }
     }
 }