コード例 #1
0
        private void _newGameButton_Click(object sender, EventArgs e)
        {
            Game game = new Game();
            using (GameEditorDialog dlg = new GameEditorDialog(game)) {
                dlg.StartPosition = FormStartPosition.CenterParent;
                if (dlg.ShowDialog(this) != DialogResult.OK) return;

                _gameRepository.Add(game);
                _bindingSource.Position = _bindingSource.IndexOf(game);
                UpdateButtons();
            }
        }
コード例 #2
0
 private void _gameListBox_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     Game game = (Game)_gameListBox.SelectedItem;
     Game gameClone = new Game(game);
     GameEditorDialog edit = new GameEditorDialog(gameClone);
     if (edit.ShowDialog() == DialogResult.OK) {
         _gameListBox.SelectedItem = gameClone;
     }
 }