Ejemplo n.º 1
0
 private void InventoryList_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         var armor = GetArmorFromSelected();
         SelectedInventorySkill.Clear();
         var skills = armor.PrintSkills().Split('|');
         for (int i = 0; i < skills.Length - 1; i++)
         {
             SelectedInventorySkill.AppendText(skills[i]);
             SelectedInventorySkill.AppendText(Environment.NewLine);
         }
         SelectedInventorySkill.AppendText(skills.Last());
     }
     catch (NullReferenceException) { }
     catch (ArgumentOutOfRangeException) { }
 }
Ejemplo n.º 2
0
 private void InventoryList_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         var inventory = _state.Player.Inventory.Inventory;
         var armor     = inventory[InventoryList.SelectedIndex - 1];
         SelectedInventorySkill.Clear();
         var skills = armor.PrintSkills().Split('|');
         for (int i = 0; i < skills.Length - 1; i++)
         {
             SelectedInventorySkill.AppendText(skills[i]);
             SelectedInventorySkill.AppendText(Environment.NewLine);
         }
         SelectedInventorySkill.AppendText(skills.Last());
     }
     catch (NullReferenceException) { }
     catch (ArgumentOutOfRangeException)
     {
         if (InventoryList.Items.Count > 1)
         {
             InventoryList.SelectedIndex = 1;
         }
     }
 }