public virtual void OnWizardBack(WizardPageEventArgs e)
 {
     if (WizardBack != null)
     {
         WizardBack(this, e);
     }
 }
 public virtual void OnWizardNext(WizardPageEventArgs e)
 {
     if (WizardNext != null)
     {
         WizardNext(this, e);
     }
 }
示例#3
0
        private void backButton_Click(object sender, EventArgs e)
        {
            WizardPageEventArgs wpea = PreChangePage(-1);

            _activePage.OnWizardBack(wpea);
            PostChangePage(wpea);
        }
示例#4
0
        private void nextButton_Click(object sender, EventArgs e)
        {
            WizardPageEventArgs wpea = PreChangePage(+1);

            _activePage.OnWizardNext(wpea);
            PostChangePage(wpea);
        }
示例#5
0
 private void PostChangePage(WizardPageEventArgs e)
 {
     if (!e.Cancel)
     {
         SetActivePage(e.NewPage);
     }
 }
示例#6
0
        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);
        }