public void CountDown(int t)
        {
            CountDownTimerEventArgs args = new CountDownTimerEventArgs()
            {
                Countdowntime = t
            };

            CountDownHandler(this, args);
        }
Exemple #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!");
         }
     }
 }