private void TbOpenClick(object sender, EventArgs e) { try { // check if current game is saved if (this.IsGameSaved == false) { DialogResult dResult = MessageBox.Show("Do you want to save this game\n\rBefore opening another one?", "Save Game?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dResult == DialogResult.Yes) { SaveGameData(); SaveScoreCard(); } } frmOpen mf = new frmOpen(); mf.ShowDialog(); if (mf.DialogResult == DialogResult.OK) { txtPlayerName.Text = PlayerName; lblRollNumber.Text = "0"; intRollNumber = 0; lblHold1.Visible = false; lblHold2.Visible = false; lblHold3.Visible = false; lblHold4.Visible = false; lblHold5.Visible = false; btnRoll.Enabled = true; LoadSavedGame(); SetEnabled(true); NewRollGroup(); } SetHighScores(); IsGameSaved = true; } catch (System.Exception ex) { EmailError.frmError eForm = new EmailError.frmError(ex.ToString(), mVersion); eForm.ShowDialog(); } }
private void TbOpenClick(object sender, EventArgs e) { try { // check if current game is saved if(this.IsGameSaved == false) { DialogResult dResult = MessageBox.Show("Do you want to save this game\n\rBefore opening another one?", "Save Game?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if(dResult == DialogResult.Yes) { SaveGameData(); SaveScoreCard(); } } frmOpen mf = new frmOpen(); mf.ShowDialog(); if(mf.DialogResult == DialogResult.OK) { txtPlayerName.Text = PlayerName; lblRollNumber.Text = "0"; intRollNumber = 0; lblHold1.Visible = false; lblHold2.Visible = false; lblHold3.Visible = false; lblHold4.Visible = false; lblHold5.Visible = false; btnRoll.Enabled = true; LoadSavedGame(); SetEnabled(true); NewRollGroup(); } SetHighScores(); IsGameSaved = true; } catch(System.Exception ex) { EmailError.frmError eForm = new EmailError.frmError(ex.ToString(), mVersion); eForm.ShowDialog(); } }