Exemple #1
0
 private void selectCharacter()
 {
     int index = comboBoxCharacter.SelectedIndex;
     if (index < 0 || index > Characters.Count) selectedCharacter = null;
     else selectedCharacter = Characters[index];
     bindings.Target = selectedCharacter;
     if (selectedCharacter == null) this.comboBoxCharacter.Text = "";
     updateCharacterName();
 }
Exemple #2
0
        private void updateCharacterName()
        {
            Character character = selectedCharacter;
            if (character == null) character = new Character();

            this.groupBoxCharacter.Text = character.Name;
            if (this.comboBoxCharacter.SelectedIndex >= 0)
            {
                if ((string) this.comboBoxCharacter.Items[this.comboBoxCharacter.SelectedIndex] != character.Name)
                {
                    this.comboBoxCharacter.Items[this.comboBoxCharacter.SelectedIndex] = character.Name;
                }
            }
        }