/// <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); }
/// <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; }