/// <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++; }
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); }
/// <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"); } }