/// <summary> /// The display game over. /// </summary> /// <param name="gameResult"> /// The game result. /// </param> public void DisplayGameOver(bool gameResult) { this.isGridInitialized = false; if (gameResult == false) { MessageBox.Show("Game Over!", "Minesweeper", MessageBoxButton.OK, MessageBoxImage.Error); } else { var unprotectedButtons = this.buttons.Where(b => (string)b.Content == string.Empty); foreach (var upb in unprotectedButtons) { upb.Background = this.images[1]; } var protectedButtons = this.buttons.Where(b => b.Background.Equals(this.images[1])); foreach (var pb in protectedButtons) { pb.IsHitTestVisible = false; } var inputBox = new InputBox(this.PlayerAdd); inputBox.Show(); } }
private void New_Click(object sender, RoutedEventArgs e) { Save.IsEnabled = true; inputBox = new InputBox(); inputBox.Show(); level.blocks = new List<GObject>(); level.gums = new List<GObject>(); level.bonus = new List<GObject>(); canvas1.Children.Clear(); scrollBar1.Maximum = level.lenghtLevel; scrollBar1.Value = 0; }