Esempio n. 1
0
        private void OnIntervalCompleted(IntervalReachedEventArgs arguments)
        {
            IntervalEventHandler handler = IntervalCompleted;

            if (handler != null)
            {
                handler(this, arguments);
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 private void OnIntervalCompleted(IntervalReachedEventArgs arguments)
 {
     IntervalEventHandler handler = IntervalCompleted;
     if (handler != null)
     {
         handler(this, arguments);
     }
 }
Esempio n. 4
0
        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);
        }