Пример #1
0
        /// <summary>
        /// Opens up the UI to create your fantasy character (Character->New)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnCharacterNew(object sender, EventArgs e)
        {
            //Display UI
            var form = new CreateNewCharacterForm();

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

            for (var index = 0; index < _characters.Length; ++index)
            {
                if (_characters[index] == null)
                {
                    _characters[index] = form.Character;
                    break;
                }
            }
            BindList();
        }
Пример #2
0
        /// <summary>
        /// To make changes a character(s) (Character->Edit)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnCharacterEdit(object sender, EventArgs e)
        {
            var form = new CreateNewCharacterForm();

            var character = GetSelectedCharacter();

            if (character == null)
            {
                return;
            }

            //Game to edit
            form.Character = character;

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


            UpdateCharacter(character, form.Character);

            BindList();
        }