Beispiel #1
0
 public void DeleteCharacter(CharacterClass chrDel, frmListCharacters FLC)
 {
     bool Found = false;
     if (chrDel != null)
     {
         foreach (CharacterClass CC in CBC[0].Characters)
         {
             if (!Found)
             {
                 if (CC == chrDel)
                     Found = true;
             }
         }
     }
     if (Found)
     {
         CBC[0].Characters.Remove(chrDel);
         MessageBox.Show("Character has been deleted.", "Success");
     }
     else
         MessageBox.Show("Couldn't delete character.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     FLC.PopulateCharacters(CBC[0].Characters);
     blDataSaved = false;
     CheckStatus();
 }
Beispiel #2
0
        private void listToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (CBC[0].Characters.Count > 0)
            {
                this.Enabled = false;
                frmListCharacters F = new frmListCharacters();
                F.Show();
                F.MainForm = this;

                F.PopulateCharacters(CBC[0].Characters);
            }
            else
            {
                MessageBox.Show("There are no characters. Please add characters so you can list them.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }