private void OnCharacterNew(object sender, EventArgs e) { var form = new CharacterForm(); if (form.ShowDialog(this) == DialogResult.Cancel) { return; } _database.Add(form.Character); RefreshCharacters(); }
private void EditCharacter() { var item = GetSelectedCharacter(); if (item == null) { return; } var form = new CharacterForm(); form.Text = "Edit Character"; form.Character = item; if (form.ShowDialog(this) == DialogResult.Cancel) { return; } _database.Edit(item.Name, form.Character); RefreshCharacters(); }