Exemple #1
0
        private void backButton_Click(object sender, EventArgs e)
        {
            WizardPageEventArgs wpea = PreChangePage(-1);

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

            _activePage.OnWizardNext(wpea);
            PostChangePage(wpea);
        }
Exemple #3
0
 private void PostChangePage(WizardPageEventArgs e)
 {
     if (!e.Cancel)
     {
         SetActivePage(e.NewPage);
     }
 }
Exemple #4
0
 public virtual void OnWizardBack(WizardPageEventArgs e)
 {
     if (WizardBack != null)
     {
         WizardBack(this, e);
     }
 }
Exemple #5
0
 public virtual void OnWizardNext(WizardPageEventArgs e)
 {
     if (WizardNext != null)
     {
         WizardNext(this, e);
     }
 }
Exemple #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 = (WizardPage)_pages[nextIndex];

            WizardPageEventArgs e = new WizardPageEventArgs();

            e.NewPage = newPage.Name;
            e.Cancel  = false;

            return(e);
        }