private void SecondsCounter(object sender, TimerEventArgs e)
 {
     if (e.Seconds > 0)
     {
         this.SecondsLeft--;
     }
     else
     {
         this.timer.Stop();
         this.timer.Enabled = false;
         this.timer.Dispose();
         this.Alarm?.Invoke(this, new TimerEventArgs(this.alarmPeriod));
     }
 }
Esempio n. 2
0
 private static void Alarm(object sender, TimerEventArgs e)
 {
     Console.WriteLine("Time's up - exiting");
     Console.Beep();
     isrunning = false;
 }
Esempio n. 3
0
 private static void DisplayCountDown(object sender, TimerEventArgs e)
 {
     Console.WriteLine(e.Seconds);
 }