//TODO missing functionality here private void OnGameAdd(object sender, EventArgs e) { //Display UI var form = new GameForm(); //Modeless form.Show(); // //Modal // if (form.ShowDialog(this) != DialogResult.OK) // return; // //TODO: Add //_games[GetNextEmptyGame()] = form.Game; //BindList(); }
private void OnSafeAdd(GameForm form) { try { //_games[GetNextEmptyGame()] = form.Game; _games.Add(form.Game); } catch (NotImplementedException e) { //Rewriting an exception throw new Exception("Not implemented yet", e); } catch (Exception e) { //Log a message //Rethrow exception - wrong way //throw e; throw; }; }
private void OnGameEdit(object sender, EventArgs e) { var form = new GameForm(); var game = GetSelectedGame(); if (game == null) { return; } //Game to edit form.Game = game; if (form.ShowDialog(this) != DialogResult.OK) { return; } //TODO: Fix to edit, not add UpdateGame(game, form.Game); BindList(); }