Exemple #1
0
        private void SetActivePage(WizardPage newPage)
        {
            try
            {
                WizardPage            oldActivePage;
                WizardCancelEventArgs e;


                oldActivePage = __ActivePage;

                if (!pnlPages.Controls.Contains(newPage))
                {
                    pnlPages.Controls.Add(newPage);
                }

                newPage.Visible = true;
                newPage.Dock    = DockStyle.Fill;

                if (oldActivePage != null)
                {
                    oldActivePage.Visible = false;
                }

                __ActivePage = newPage;

                e = new WizardCancelEventArgs();
                e.PreviousPage = oldActivePage;

                newPage.OnSetActive(this, e);

                if (e.Cancel)
                {
                    newPage.Visible = false;

                    __ActivePage = oldActivePage;
                }

                foreach (WizardPage page in Pages)
                {
                    if (page != __ActivePage)
                    {
                        page.Visible = false;
                    }
                }
            }
            catch (Exception exception)
            {
                System.Diagnostics.Debug.Assert(false, exception.Message);

                throw;
            }
        }
Exemple #2
0
        public virtual void OnSetActive(object sender, WizardCancelEventArgs e)
        {
            try
            {
                if (SetActive != null)
                {
                    SetActive(sender, e);
                }

                GetWizard( ).SetWizardButtons(GetWizardButtons( ));
            }
            catch (Exception exception)
            {
                System.Diagnostics.Debug.Assert(false, exception.Message);

                throw;
            }
        }