Exemplo n.º 1
0
        private void backButton_Click(object sender, EventArgs e)
        {
            WizardPageEventArgs wpea = PreChangePage(-1);

            _activePage.OnWizardBack(wpea);
            PostChangePage(wpea);
        }
Exemplo n.º 2
0
 private void PostChangePage(WizardPageEventArgs e)
 {
     if (!e.Cancel)
     {
         SetActivePage(e.NewPage);
     }
 }
Exemplo n.º 3
0
 public virtual void OnWizardBack(WizardPageEventArgs e)
 {
     if (WizardBack != null)
     {
         WizardBack(this, e);
     }
 }
Exemplo n.º 4
0
 public virtual void OnWizardNext(WizardPageEventArgs e)
 {
     if (WizardNext != null)
     {
         WizardNext(this, e);
     }
 }
Exemplo n.º 5
0
        private void nextButton_Click(object sender, EventArgs e)
        {
            _activePage.Prepare();
            WizardPageEventArgs wpea = PreChangePage(+1);

            _activePage.OnWizardNext(wpea);
            PostChangePage(wpea);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 换页预处理
        /// </summary>
        /// <param name="delta"></param>
        /// <returns></returns>
        private WizardPageEventArgs PreChangePage(int delta)
        {
            // Figure out which page is next.
            int activeIndex = GetActiveIndex();
            int nextIndex   = activeIndex + delta;

            if (nextIndex < 0 || nextIndex >= Context.Pages.Count)
            {
                nextIndex = activeIndex;
            }

            // Fill in the event args.
            WizardPage newPage = Context.Pages[nextIndex];

            WizardPageEventArgs e = new WizardPageEventArgs {
                NewPage = newPage.Name, Cancel = false
            };

            return(e);
        }