public void ShowHighscores() { using (var highscoresDialog = new HighscoresForm()) { highscoresDialog.ShowDialog(); } }
private void OnGameWon(object sender, GameWonEventArgs e) { using (var dialog = new GameWonForm()) { if (dialog.ShowDialog() == DialogResult.OK) { Settings.Default.Highscores.Add(new HighscoreEntry { Nickname = dialog.Nickname, Time = e.Time, BoardSize = mainView.Rows + "x" + mainView.Columns }); Settings.Default.Save(); } } using (HighscoresForm highscoresDialog = new HighscoresForm()) { highscoresDialog.ShowDialog(); } }