Beispiel #1
0
        /// <summary>
        /// Moves the wizard back one step.
        /// </summary>
        public void back()
        {
            try
            {
                CancelEventArgs cea = new CancelEventArgs();
                if (BackCalled != null)
                {
                    BackCalled(this, cea);
                }
                if (cea.Cancel)
                {
                    return;
                }

                WizardStep step = (WizardStep)wizardSteps[wizardStepIndex];
                WizardStepIndex--;

                //notify the current step that its previous operation should be rolled back.
                WizardStep newStep = (WizardStep)wizardSteps[wizardStepIndex];
                newStep.UndoNext();

                //Note: the step.Back() must occur after decrementing the step
                //index just in case the back operation removes substeps.
                step.Back();
            }
            catch (OperationCancelledException)
            {
                this.WizardControl.Cancel();
            }
        }