Ejemplo n.º 1
0
        /// <devdoc>
        /// Goes to the next panel in the wizard.
        /// </devdoc>
        public void NextPanel()
        {
            WizardPanel currentPanel = _panelHistory.Peek();

            if (currentPanel.OnNext())
            {
                currentPanel.Hide();
                WizardPanel nextPanel = currentPanel.NextPanel;
                if (nextPanel != null)
                {
                    RegisterPanel(nextPanel);
                    _panelHistory.Push(nextPanel);
                    OnPanelChanging(new WizardPanelChangingEventArgs(currentPanel));
                    ShowPanel(nextPanel);
                }
            }
        }
Ejemplo n.º 2
0
        /// <devdoc>
        /// Click event handler for the Finish button.
        /// </devdoc>
        protected virtual void OnFinishButtonClick(object sender, System.EventArgs e)
        {
            WizardPanel currentPanel = _panelHistory.Peek();

            if (currentPanel.OnNext())
            {
                // Call OnComplete for every panel on the stack
                WizardPanel[] panels = _panelHistory.ToArray();
                Array.Reverse(panels);
                foreach (WizardPanel panel in panels)
                {
                    panel.OnComplete();
                }

                DialogResult = DialogResult.OK;
                Close();
            }
        }