Ejemplo n.º 1
0
        /// <summary>
        /// Changes the current step.
        /// </summary>
        /// <param name="step">The new current step.</param>
        /// <param name="forward"><c>true</c> if we're stepping forward in the wizard.</param>
        public void StepTo(IWizardStep step, bool forward)
        {
            try
            {
                inStepTo = true;

                if (current != null && !current.OnStepOut(this, forward))
                {
                    return;
                }

                current = step;

                if (step != null)
                {
                    step.OnStepIn(this);
                }

                wizard.OnStep(this, step);
            }
            finally
            {
                inStepTo = false;

                if (skipToFinish)
                {
                    skipToFinish = false;
                    StepTo(LastStep, false);
                }
            }
        }