Exemple #1
0
 private void OnCharacterNew(object sender, EventArgs e)
 {
     do
     {
         CreateNewCharacterForm characterCreator = new CreateNewCharacterForm();
         characterCreator.StartPosition = FormStartPosition.CenterParent;
         DialogResult dr = characterCreator.ShowDialog(this);
         if (dr == DialogResult.Cancel)
         {
             characterCreator.Close();
             break;
         }
         else   // dr == DialogResult.OK
         {
             try
             {
                 _roster.Add(characterCreator.ReturnCharacter);
             }
             catch (Exception ex)
             {
                 DisplayError("Add failed", ex.Message);
             }
             UpdatelbCharacters();
             characterCreator.Close();
             break;
         }
     } while (true);
 }
Exemple #2
0
 private void OnCharacterNew(object sender, EventArgs e)
 {
     do
     {
         CreateNewCharacterForm characterCreator = new CreateNewCharacterForm();
         characterCreator.StartPosition = FormStartPosition.CenterParent;
         DialogResult dr = characterCreator.ShowDialog(this);
         if (dr == DialogResult.Cancel)
         {
             characterCreator.Close();
             break;
         }
         else   // dr == DialogResult.OK
         {
             _roster.Add(characterCreator.ReturnCharacter, out var error);
             if (!String.IsNullOrEmpty(error))
             {
                 DisplayError("Add Failed", error);
             }
             else
             {
                 UpdatelbCharacters();
                 characterCreator.Close();
                 break;
             }
         }
     } while (true);
 }