protected internal virtual void RemoveAllSteps() { WizardControl wizardControl = WizardControl; if (wizardControl == null) { return; } if (MessageBox.Show(wizardControl.FindForm(), "Are you sure you want to remove all the steps?", "Remove Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; } IDesignerHost service = (IDesignerHost)GetService(typeof(IDesignerHost)); if (service == null) { return; } WizardStep[] array = new WizardStep[wizardControl.WizardSteps.Count]; wizardControl.WizardSteps.CopyTo(array, 0); wizardControl.WizardSteps.Clear(); WizardStep[] stepArray2 = array; for (int index = 0; index < stepArray2.Length; index++) { WizardStep component = stepArray2[index]; service.DestroyComponent(component); index++; } SelectWizard(); }
protected internal virtual void RemoveStep() { IDesignerHost service = (IDesignerHost)GetService(typeof(IDesignerHost)); if (WizardControl == null || service == null) { return; } if (MessageBox.Show(WizardControl.FindForm(), "Are you sure you want to remove the step?", "Remove Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { WizardStep step = WizardControl.WizardSteps[WizardControl.CurrentStepIndex]; WizardControl.WizardSteps.Remove(step); service.DestroyComponent(step); step.Dispose(); } SelectWizard(); }