示例#1
0
        private void OnCharacterNew(object sender, EventArgs e)
        {
            var form = new CharacterForm();

            if (form.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }

            _database.Add(form.Character);
            RefreshCharacters();
        }
示例#2
0
        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();
        }