private void OnMessageBoxAnswered(MessageBoxAnsweredEventArgs mba) { if (MessageBoxAnswered != null) { MessageBoxAnswered(this, mba); } }
private void m_FormGame_MessageBoxAnswered(object sender, EventArgs e) { MessageBoxAnsweredEventArgs mba = e as MessageBoxAnsweredEventArgs; if (mba.IsAnsweredYes) { m_AmericanCheckers_NewGameStarted(sender, e); } else { m_FormGame.Close(); } }
public void CreateYesNoMessageBox(string i_MessageBoxString, string i_Caption) { DialogResult dialogResult = MessageBox.Show(i_MessageBoxString, i_Caption, MessageBoxButtons.YesNo); MessageBoxAnsweredEventArgs mba; bool isMessageBoxAnswerIsYes = false; if (dialogResult == DialogResult.Yes) { isMessageBoxAnswerIsYes = true; } else if (dialogResult == DialogResult.No) { isMessageBoxAnswerIsYes = false; } mba = new MessageBoxAnsweredEventArgs(isMessageBoxAnswerIsYes); OnMessageBoxAnswered(mba); }