private void OnIntervalCompleted(IntervalReachedEventArgs arguments)
        {
            IntervalEventHandler handler = IntervalCompleted;

            if (handler != null)
            {
                handler(this, arguments);
            }
        }
        private void InternalTimerTriggered(object state)
        {
            _timer.Dispose();

            // Fire off an event.
            IntervalReachedEventArgs args = new IntervalReachedEventArgs(_position);

            OnIntervalCompleted(args);

            _position = (_position + 1) % _durations.Count;

            bool shouldTerminate = _position == 0 && !Repeat;

            if (shouldTerminate)
            {
                return;
            }

            // Set the next timer going.
            TimeSpan nextDuration = (TimeSpan)_durations[_position];

            _timer = new ExtendedTimer(InternalTimerTriggered, _position, TimeSpan.Zero, nextDuration);
        }
 private void OnIntervalCompleted(IntervalReachedEventArgs arguments)
 {
     IntervalEventHandler handler = IntervalCompleted;
     if (handler != null)
     {
         handler(this, arguments);
     }
 }
        private void InternalTimerTriggered(object state)
        {
            _timer.Dispose();

            // Fire off an event.
            IntervalReachedEventArgs args = new IntervalReachedEventArgs(_position);
            OnIntervalCompleted(args);

            _position = (_position + 1) % _durations.Count;

            bool shouldTerminate = _position == 0 && !Repeat;
            if (shouldTerminate)
            {
                return;
            }

            // Set the next timer going.
            TimeSpan nextDuration = (TimeSpan)_durations[_position];
            _timer = new ExtendedTimer(InternalTimerTriggered, _position, TimeSpan.Zero, nextDuration);
        }