private void newToolStripMenuItem_Click(object sender, EventArgs e) { var newCharForm = new NewCharacterFrom(); newCharForm.StartPosition = FormStartPosition.CenterParent; if (newCharForm.ShowDialog(this) == DialogResult.OK) { AddCharacter(newCharForm.character); } }
private void editToolStripMenuItem_Click(object sender, EventArgs e) { if (!_characters.Any()) { MessageBox.Show("No Characters to edit", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (listBoxRoster.SelectedIndex == -1) { MessageBox.Show("Select a Character to edit", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var newCharForm = new NewCharacterFrom((Character)listBoxRoster.SelectedItem); newCharForm.StartPosition = FormStartPosition.CenterParent; if (newCharForm.ShowDialog(this) == DialogResult.OK) { EditCharacter(newCharForm.character); } }