コード例 #1
0
        private void AddToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var form = new CreateNewCharacter();

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                AddCharacter(form.Character);
            }
            UpdateUI();
        }
コード例 #2
0
        private void EditToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var character = GetSelectedCharacter();

            if (character == null)
            {
                return;
            }

            var form = new CreateNewCharacter();

            form.Character = character;

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                RemoveCharacter(character);
                AddCharacter(form.Character);
                UpdateUI();
            }
        }