Example #1
0
        /// <summary>
        /// Adds a ProgressLinkedStep to this group.
        /// </summary>
        /// <param name="step">The ProgressLinkedStep to add.</param>
        public void AddStep(ProgressLinkedStep step)
        {
            int position = _stepPositions.Count;

            _stepPositions[step] = position;
            _numPositions++;
        }
Example #2
0
        private IStep DecorateStep(IStep step, ProgressBarGroup progressBarGroup, bool setupProgressBar)
        {
            IStep result = step;

            if (setupProgressBar)
            {
                result = DecorateWithProgressSetup(step);
            }
            if (progressBarGroup != null)
            {
                result = new ProgressLinkedStep(result, progressBarGroup);
            }
            return(result);
        }
Example #3
0
        /// <summary>
        /// Activates a ProgressLinkedStep, updating any attached progress bars.
        /// </summary>
        public void ActivateStep(ProgressLinkedStep step)
        {
            int position;

            if (_stepPositions.TryGetValue(step, out position))
            {
                _progressRangeStart = (double)position / _numPositions;
                _progressRangeEnd   = (double)(position + 1) / _numPositions;
                OnProgressChanged(_progressRangeStart);
            }
            else
            {
                throw new InvalidOperationException("Cannot activate a node that is not part of this group");
            }
        }