/// <summary> /// Method that is getting called when the game is over. /// </summary> private void GameIsOver() { this.timer.Stop(); string playerName = string.Empty; var win = new GameOver(); if (win.ShowDialog() == true) { playerName = win.PlayerName; } else { playerName = "NaN"; } this.gl.WriteHighScore(playerName); HighScores hs = new HighScores(); hs.Show(); this.Close(); }