/// <summary> /// Start the wizard by displaying the first page. /// </summary> /// <param name="owner"></param> public DialogResult StartWizard(IWin32Window owner) { ValidatePages(); activeForm = wizardFormFactory.NewForm(); activeForm.CancelButtonObject.Click += new EventHandler(buttonCancel_Click); activeForm.BackButton.Click += new EventHandler(buttonBack_Click); activeForm.NextButton.Click += new EventHandler(buttonNext_Click); activeForm.FinishButton.Click += new EventHandler(buttonFinish_Click); currentPage = -1; NextPage(); DialogResult formResult = DialogResult.None; if (owner == null) { formResult = activeForm.ShowDialog(); } else { formResult = activeForm.ShowDialog(owner); } return(formResult); }
private void SetUpCommonExpectationsOnForm(WizardForm mockForm) { Expect.Call(mockForm.ShowDialog()).Return(DialogResult.OK); Expect.Call(mockForm.CancelButtonObject).Return(new Button()); Expect.Call(mockForm.BackButton).Repeat.Any().Return(new Button()); Expect.Call(mockForm.NextButton).Repeat.Any().Return(new Button()); Expect.Call(mockForm.FinishButton).Repeat.Any().Return(new Button()); Expect.Call(mockForm.LabelPageTitle).Return(new Label()); Expect.Call(mockForm.PageContainer).Repeat.Any().Return(new Panel()); }