Beispiel #1
0
 public void LongBreakTimer()// таймер перерыва
 {
     whatistimer      = 0;
     _StartTimeSpan   = TimeSpan.FromMinutes(15);
     _timer3          = new DispatcherTimer();
     _timer3.Interval = _interval;
     _timer3.Tick    += delegate
     {
         var now     = DateTime.Now;
         var elapsed = now.Subtract(_startCountdown);
         TimeToEnd          = _StartTimeSpan.Subtract(elapsed);
         labelTimer.Content = TimeToEnd.ToString(@"mm\:ss");
     };
 }
Beispiel #2
0
 public void WorkTimer()// таймер работы
 {
     whatistimer     = 1;
     _StartTimeSpan  = TimeSpan.FromMinutes(25);
     _timer          = new DispatcherTimer();
     _timer.Interval = _interval;
     _timer.Tick    += delegate
     {
         var now     = DateTime.Now;
         var elapsed = now.Subtract(_startCountdown);
         TimeToEnd          = _StartTimeSpan.Subtract(elapsed);
         labelTimer.Content = TimeToEnd.ToString(@"mm\:ss");
     };
     LongCount++;
     if (LongCount == 4)
     {
         whatistimer = 2;
         LongCount   = 0;
     }
 }
Beispiel #3
0
 private void EventStopTimer()
 {
     _timer.Stop();
     TimeToEnd          = _StartTimeSpan;
     labelTimer.Content = TimeToEnd.ToString(@"mm\:ss");
 }