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(); }
protected internal virtual void RemoveAllSteps() { IDesignerHost service = (IDesignerHost)GetService(typeof(IDesignerHost)); if (WizardControl == null || service == 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; } WizardStep[] array = new WizardStep[WizardControl.WizardSteps.Count]; ((ICollection)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(); }