Example #1
0
 void StopHelper()
 {
     if (SecondTimer != null)
     {
         SecondTimer.Stop();
     }
     _IsRunning = false;
     IsRunningFeedback.FireUpdate();
 }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        public void Start()
        {
            if (_IsRunning)
            {
                return;
            }
            StartTime  = DateTime.Now;
            FinishTime = StartTime + TimeSpan.FromSeconds(SecondsToCount);

            if (SecondTimer != null)
            {
                SecondTimer.Stop();
            }
            SecondTimer = new CTimer(SecondElapsedTimerCallback, null, 0, 1000);
            _IsRunning  = true;
            IsRunningFeedback.FireUpdate();

            var handler = HasStarted;

            if (handler != null)
            {
                handler(this, new EventArgs());
            }
        }