Beispiel #1
0
        /// <summary>
        /// Method Raise "Cancel" event and then if property ShowConfirm is set, show
        /// Confirmation Dialog. If user Choose Yes on Confirmation then "WizardClosed"
        /// event thrown to user. In Event Handler user can chage message and title of
        /// Confirmation Message Box.
        /// </summary>
        protected virtual DialogResult OnCancelPressed()
        {
            EventWizardCancelArgs e = new EventWizardCancelArgs(DEF_WARNING, DEF_CLOSE);

            if (Cancel != null && m_bFireEvents == true)
            {
                Cancel(this, e);
            }

            if (m_bShowConfirm == true)
            {
                DialogResult result = MessageBox.Show(this, e.Message, e.Title, MessageBoxButtons.YesNo);

                if (result == DialogResult.Yes)
                {
                    m_bCancelCalled = true;
                    OnWizardClosed();
                    return(DialogResult.Yes);
                }
            }

            return(DialogResult.No);
        }
Beispiel #2
0
        /// <summary>
        /// Method Raise "Cancel" event and then if property ShowConfirm is set, show
        /// Confirmation Dialog. If user Choose Yes on Confirmation then "WizardClosed"
        /// event thrown to user. In Event Handler user can chage message and title of 
        /// Confirmation Message Box. 
        /// </summary>
        protected virtual DialogResult OnCancelPressed()
        {
            EventWizardCancelArgs e = new EventWizardCancelArgs( DEF_WARNING, DEF_CLOSE );

              if( Cancel != null && m_bFireEvents == true )
              {
            Cancel( this, e );
              }

              if( m_bShowConfirm == true )
              {
            DialogResult result = MessageBox.Show( this, e.Message, e.Title, MessageBoxButtons.YesNo );

            if( result == DialogResult.Yes )
            {
              m_bCancelCalled = true;
              OnWizardClosed();
              return DialogResult.Yes;
            }
              }

              return DialogResult.No;
        }