Beispiel #1
0
 /// <summary>
 /// Add a wizard step at the specified index
 /// </summary>
 /// <param name="step">The new wizard step</param>
 /// <param name="index">The index to insert the step at</param>
 public void addWizardStep(int index, WizardStep step)
 {
     //add the new step
     step.Wizard = this;
     if (index > wizardSteps.Count)
     {
         wizardSteps.Add(step);
     }
     else
     {
         wizardSteps.Insert(index, step);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Moves the wizard forward one step.
        /// </summary>
        public void next()
        {
            try
            {
                WizardStep step = (WizardStep)wizardSteps[wizardStepIndex];
                if (!step.Verify())
                {
                    //the step validation failed, so don't proceed.
                    //Note: This assumes that the step displayed an error message
                    //indicating why the step didn't proceed.
                    return;
                }

                CancelEventArgs cea = new CancelEventArgs();
                if (NextCalled != null)
                {
                    NextCalled(this, cea);
                }
                if (cea.Cancel)
                {
                    return;
                }

                //Note: the step.Next() must occur before incrementing the step
                //index just in case the Next() operation adds substeps.
                step.Next();
                if (wizardStepIndex < wizardSteps.Count - 1)
                {
                    WizardStepIndex++;
                }
                else
                {
                    Finish();
                }
            }
            catch (CancelNextException)
            {
                //next was cancelled.
            }
            catch (OperationCancelledException)
            {
                this.WizardControl.Cancel();
            }
        }
Beispiel #3
0
        /// <summary>
        /// Remove a step from the wizard.
        /// </summary>
        /// <param name="step">The wizard step to remove</param>
        public void removeWizardStep(WizardStep step)
        {
            // save the current index of the step
            int stepIndex = wizardSteps.IndexOf(step);

            if (stepIndex != -1)
            {
                // remove the step
                wizardSteps.Remove(step);

                // if the step index was less than the current step
                // then decrement the current step index
                if (stepIndex < wizardStepIndex)
                {
                    wizardStepIndex--;
                }
            }
            else
            {
                Trace.Fail("Attempted to remove step that doesn't exist!");
            }
        }
 /// <summary>
 /// Adds a step to the wizard.
 ///
 /// </summary>
 /// <param name="step">The new wizard step</param>
 public void addWizardStep(WizardStep step)
 {
     addWizardStep(wizardSteps.Count, step);
 }
 public bool StepExists(WizardStep step)
 {
     return GetIndexOfStep(step) != -1;
 }
 public int GetIndexOfStep(WizardStep step)
 {
     return wizardSteps.IndexOf(step);
 }
        /// <summary>
        /// Remove a step from the wizard.
        /// </summary>
        /// <param name="step">The wizard step to remove</param>
        public void removeWizardStep(WizardStep step)
        {
            // save the current index of the step
            int stepIndex = wizardSteps.IndexOf(step);
            if (stepIndex != -1)
            {
                // remove the step
                wizardSteps.Remove(step);

                // if the step index was less than the current step
                // then decrement the current step index
                if (stepIndex < wizardStepIndex)
                    wizardStepIndex--;
            }
            else
            {
                Trace.Fail("Attempted to remove step that doesn't exist!");
            }
        }
 public WizardSettingsAutoDetectionOperation(WizardStep editWithStyleStep)
 {
     _editWithStyleStep = editWithStyleStep;
 }
 public WizardSharePointAutoDetectionOperation(WizardStep editWithStyleStep)
     : base(editWithStyleStep)
 {
 }
Beispiel #10
0
 /// <summary>
 /// Let subclasses know when users moves from one page to another inside the wizard.
 /// </summary>
 /// <param name="oldStep"></param>
 /// <param name="newStep"></param>
 virtual protected void OnStepChanging(WizardStep oldStep, WizardStep newStep)
 {
 }
Beispiel #11
0
 /// <summary>
 /// Adds a step to the wizard.
 ///
 /// </summary>
 /// <param name="step">The new wizard step</param>
 public void addWizardStep(WizardStep step)
 {
     addWizardStep(wizardSteps.Count, step);
 }
Beispiel #12
0
 public bool StepExists(WizardStep step)
 {
     return(GetIndexOfStep(step) != -1);
 }
Beispiel #13
0
 public int GetIndexOfStep(WizardStep step)
 {
     return(wizardSteps.IndexOf(step));
 }
 /// <summary>
 /// Add a wizard step at the specified index
 /// </summary>
 /// <param name="step">The new wizard step</param>
 /// <param name="index">The index to insert the step at</param>
 public void addWizardStep(int index, WizardStep step)
 {
     //add the new step
     step.Wizard = this;
     if (index > wizardSteps.Count)
         wizardSteps.Add(step);
     else
         wizardSteps.Insert(index, step);
 }
        /// <summary>
        /// Displays the current wizard step.
        /// </summary>
        internal protected void DisplayWizardStep(WizardStep step, int currentStep, int totalSteps)
        {
            SuspendLayout();
            try
            {
                //step.Control.Visible = true;
                SetWizardBody(step.Control);

                this.Header = step.Header;
                if (step.NextButtonLabel != null)
                {
                    NextButtonText = step.NextButtonLabel;
                }
                else
                {
                    if (currentStep == totalSteps - 1)
                    {
                        NextButtonText = BUTTON_TEXT_FINISH;
                    }
                    else
                    {
                        NextButtonText = BUTTON_TEXT_NEXT;
                    }
                }

                if (currentStep == 0)
                {
                    buttonBack.Enabled = false;
                }
                else
                {
                    buttonBack.Enabled = true;
                }

                this.buttonBack.Visible = totalSteps > 1;

                //drive focus to the new body control (only if the step control didn't manually drive
                //focus to one of its sub-controls)
                if (step.Control.ActiveControl == null)
                {
                    if (step.WantsFocus)
                    {
                        wizardBody.Select();
                        wizardBody.SelectNextControl(wizardBody, true, true, true, true);
                    }
                    else
                    {
                        buttonNext.Select();
                    }
                }
            }
            finally
            {
                ResumeLayout();
            }
        }
 /// <summary>
 /// Let subclasses know when users moves from one page to another inside the wizard.
 /// </summary>
 /// <param name="oldStep"></param>
 /// <param name="newStep"></param>
 virtual protected void OnStepChanging(WizardStep oldStep, WizardStep newStep)
 {
 }
        private string WelcomeWeblog(IWin32Window owner)
        {
            _preventSwitchingToWeblog = true;
            // welcome is the same as add with one additional step on the front end
            WizardStep wizardStep;
            addWizardStep(
                wizardStep = new WizardStep(new WeblogConfigurationWizardPanelWelcome(),
                StringId.ConfigWizardWelcome,
                null, null, new NextCallback(OnWelcomeCompleted), null, null));
            wizardStep.WantsFocus = false;

            addWizardStep(
                new WizardStep(new WeblogConfigurationWizardPanelConfirmation(),
                StringId.ConfigWizardComplete,
                new DisplayCallback(OnConfirmationDisplayed),
                new VerifyStepCallback(OnValidatePanel),
                new NextCallback(OnConfirmationCompleted),
                null,
                null));

            bool switchToWeblog;
            return ShowBlogWizard(ApplicationEnvironment.ProductNameQualified, owner, out switchToWeblog);
        }