Ejemplo n.º 1
0
        //--------------------------------------------------------------------------------
        /// <summary>
        /// Seeds the page chain, resizes the form to be large enough to contain the
        /// desired size of the pagePanel container, and finally, shows the start page.
        /// </summary>
        public void StartWizard()
        {
            if (m_pageCount == 0)
            {
                throw new WizardFormException("There are no pages in the wizard.");
            }
            if (m_startPage == null)
            {
                throw new WizardFormException("A start page has not been added to the wizard.");
            }
            if (m_stopPage == null)
            {
                throw new WizardFormException("A stop page has not been added to the wizard.");
            }

            this.Width  += (m_desiredPagePanelSize.Width - this.pagePanel.Size.Width);
            this.Height += (m_desiredPagePanelSize.Height - this.pagePanel.Size.Height);

            // seed the chain
            m_pageChain.GoNext(m_startPage);
            UpdateWizardForm(m_startPage);

            // broadcast the "wizard started" event
            Raise_WizardFormStartedEvent(new WizardFormStartedArgs());
        }