/// <summary> /// Closes the current page after a <see cref="WizardPage.CloseFromNext"/>, then moves to /// the Next page and calls <see cref="WizardPage.ShowFromNext"/> /// </summary> public void Next() { Debug.Assert(this.PageIndex >= 0, "Page Index was below 0"); //Tell the Application I just closed a Page int newPage = vActivePage.OnCloseFromNext(this); //Did I just press Finish instead of Next if (this.PageIndex < vPages.Count - 1 && (vActivePage.IsFinishPage == false || DesignMode == true)) { //No still going ActivatePage(newPage); //Tell the application, I have just shown a page vActivePage.OnShowFromNext(this); } else { Debug.Assert(this.PageIndex < vPages.Count, "Error I've just gone past the finish", "btnNext_Click tried to go to page " + Convert.ToString(this.PageIndex + 1) + ", but I only have " + Convert.ToString(vPages.Count)); //yep Finish was pressed if (DesignMode == false) { this.ParentForm.Close(); } } }
/// <summary> /// Moves to the page given and calls <see cref="WizardPage.ShowFromBack"/> /// </summary> /// <remarks>Does NOT call <see cref="WizardPage.CloseFromBack"/> on the current page</remarks> /// <param name="page"></param> public void BackTo(WizardPage page) { //Since we have a page to go to, then there is no need to validate most of it ActivatePage(page); //Tell the application, I have just shown a page vActivePage.OnShowFromNext(this); }