/// <summary>
        /// This implements all the confusing logic about stopping the timers at the right times
        /// </summary>
        IEnumerable <Startwatch> AdvancementEnumerable(IEnumerator <Startwatch> enumerator)
        {
            Startwatch prev = BeforeStart;

            while (enumerator.MoveNext())
            {
                // don't stop the timer if it's stop event is linked to the next one
                prev.Stop();
                yield return(prev = enumerator.Current);
            }

            if (prev != null)
            {
                prev.Stop();
            }
            enumerator.Dispose();
        }
        public void EventCompleted()
        {
            _watch.Stop();
            int len = _behaviors.Count;

            while (true)
            {
                var index = _behaviorIndex++;
                if (len <= index)
                {
                    break;
                }
                _behaviors[index](this);
            }
        }
Example #3
0
 /// <summary>
 /// This will call Stop() on the Startwatch which is being controlled
 /// </summary>
 public bool Stop()
 {
     return(Controlled.Stop());
 }