Esempio n. 1
0
 private void OnNewGame_Click(object sender, EventArgs e)
 {
     this.ClearUI();
     this.model = new MinesweeperModel(sender.ToString());
     this.SetUpUI();
 }
Esempio n. 2
0
 private void OnLoadGame_Click(object sender, EventArgs e)
 {
     if (_loadGameDialog.ShowDialog() == DialogResult.OK)
     {
         MinesweeperModel newModel =
             MinesweeperModel.LoadFromFile(_loadGameDialog.FileName);
         if (newModel != null)
         {
             this.ClearUI();
             this.model = newModel;
             this.SetUpUI();
         }
         else
         {
             MessageBox.Show("The file format was wrong. Load failed!");
         }
     }
 }