private void AddShield(ShieldData data)
        {
            if (ItemManager.ShieldData.ContainsKey(data.Name))
            {
                DialogResult result = MessageBox.Show(data.Name + " already exists. Do you want to overwrite it?",
                                                      "Existing Shield", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result != DialogResult.Yes)
                    return;

                ItemManager.ShieldData[data.Name] = data;
                LoadShields();
                return;
            }

            DetailList.Items.Add(data.ToString());

            ItemManager.ShieldData.Add(data.Name, data);
        }
 private void CancelButtonClick(object sender, EventArgs e)
 {
     Shield = null;
     CloseForm();
 }
        private void OkButtonClick(object sender, EventArgs e)
        {
            if (!IsValid() || AllowedList.Items.Count <= 0)
            {
                MessageBox.Show("Name and/or Type cannot be empty, there must be at least one allowed class!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            var allowed = (from object c in AllowedList.Items select c.ToString()).ToList();
            Shield = new ShieldData
            {
                Name = NameBox.Text,
                Type = TypeBox.Text,
                Price = (int) PriceBox.Value,
                Weight = (float) WeightBox.Value,
                DefenseValue = (int) DefenseValueBox.Value,
                DefenseModifier = (int) DefenseModifierBox.Value,
                AllowedClasses = allowed.ToArray()
            };

            CloseForm();
        }