Пример #1
0
 public void IncreaseDuration(TimeSpan increment)
 {
     TimeRemaining += increment.GetWholeSeconds();
 }
Пример #2
0
 /// <summary>
 /// Wrap up a Windows forms timer as a Countdown. Provide access to the ticking and the expired event.
 /// </summary>
 public Countdown(TimeSpan duration)
 {
     TimeRemaining = duration.GetWholeSeconds();
     timer = new Timer { Interval = (int)interval.TotalMilliseconds };
     timer.Tick += OnTimerTick;
 }