Exemplo n.º 1
0
        // This creates a Character edit form using the constructor that adds
        // new Characters
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var addForm = new CharacterEditForm();

            addForm.ShowDialog();
            _characterManager = new CharacterManager();
            populateList();
        }
Exemplo n.º 2
0
 // This creates a Character edit form using the constructor that edits
 // existing Characters
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (this.lstCharacter.SelectedIndices.Count > 0)
     {
         var editForm = new CharacterEditForm(lstCharacter.SelectedIndices[0], _characterManager);
         editForm.ShowDialog();
         _characterManager = new CharacterManager();
         populateList();
     }
     else
     {
         MessageBox.Show("Please make a selection.");
     }
 }