Example #1
0
 private void OptionsMenu_SetOptions(object sender, OptionMenuEventArgs e)
 {
     if (((OptionsMenuData)e.Data).Height != GameData.Height || ((OptionsMenuData)e.Data).Width != GameData.Width || ((OptionsMenuData)e.Data).NumberOfMines != GameData.NumberOfMines)
     {
         ResetBoard(((OptionsMenuData)e.Data).Height, ((OptionsMenuData)e.Data).Width, ((OptionsMenuData)e.Data).NumberOfMines);
     }
 }
Example #2
0
        private void CancelButtonAction(object sender, EventArgs e)
        {
            OptionsForm.Close();
            OptionMenuEventArgs oEA = new OptionMenuEventArgs();

            oEA.Data = OriginalChoices;
            OnOptionsReturn(oEA);
        }
Example #3
0
        protected virtual void OnOptionsReturn(OptionMenuEventArgs e)
        {
            EventHandler <OptionMenuEventArgs> handler = OptionsReturn;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Example #4
0
        private void OkayButtonAction(object sender, EventArgs e)
        {
            // Grab the new choices
            if (CheckInputs())
            {
                UserChoices.Height        = Int32.Parse(OptionsForm.Controls.Find("HeightTextBox", true)[0].Text);
                UserChoices.Width         = Int32.Parse(OptionsForm.Controls.Find("WidthTextBox", true)[0].Text);
                UserChoices.NumberOfMines = Int32.Parse(OptionsForm.Controls.Find("MinesTextBox", true)[0].Text);

                OptionsForm.Close();
                OptionMenuEventArgs oEA = new OptionMenuEventArgs();
                oEA.Data = UserChoices;
                OnOptionsReturn(oEA);
            }
        }