void wizardStepCollection_Removed(int index, WizardStep value) { value.Dispose(); if (this.wizardStepCollection.Count != 1) { this.UpdateButtons(); } else { this.OnSetFirstStep(); } }
protected internal virtual void RemoveStep() { IDesignerHost service = (IDesignerHost)this.GetService(typeof(IDesignerHost)); if (this.WizardControl == null || service == null) { return; } if (MessageBox.Show(this.WizardControl.FindForm(), "Are you sure you want to remove the step?", "Remove Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { WizardStep step = this.WizardControl.WizardSteps[this.WizardControl.CurrentStepIndex]; this.WizardControl.WizardSteps.Remove(step); service.DestroyComponent(step); step.Dispose(); } this.SelectWizard(); }