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));
     }
 }
Exemplo n.º 2
0
 private static void Alarm(object sender, TimerEventArgs e)
 {
     Console.WriteLine("Time's up - exiting");
     Console.Beep();
     isrunning = false;
 }
Exemplo n.º 3
0
 private static void DisplayCountDown(object sender, TimerEventArgs e)
 {
     Console.WriteLine(e.Seconds);
 }