public virtual void OnWizardBack(WizardPageEventArgs e) { if (WizardBack != null) { WizardBack(this, e); } }
public virtual void OnWizardNext(WizardPageEventArgs e) { if (WizardNext != null) { WizardNext(this, e); } }
private void backButton_Click(object sender, EventArgs e) { WizardPageEventArgs wpea = PreChangePage(-1); _activePage.OnWizardBack(wpea); PostChangePage(wpea); }
private void nextButton_Click(object sender, EventArgs e) { WizardPageEventArgs wpea = PreChangePage(+1); _activePage.OnWizardNext(wpea); PostChangePage(wpea); }
private void PostChangePage(WizardPageEventArgs e) { if (!e.Cancel) { SetActivePage(e.NewPage); } }
private WizardPageEventArgs PreChangePage(int delta) { // Figure out which page is next. int activeIndex = GetActiveIndex(); int nextIndex = activeIndex + delta; if (nextIndex < 0 || nextIndex >= _pages.Count) { nextIndex = activeIndex; } // Fill in the event args. WizardPage newPage = _pages[nextIndex]; WizardPageEventArgs e = new WizardPageEventArgs { NewPage = newPage.Name, Cancel = false }; return(e); }