Пример #1
0
        private void BT_SkillTree_Add_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            SkillTrees SkillTrees = new SkillTrees(CLB_Skills.Items.OfType <CustomSkill>().ToArray());

            SkillTrees.Show();
            SkillTrees.Focus();
            SkillTrees.FormClosing += SkillTree_FormClosing;
        }
Пример #2
0
 private void BT_SkillTree_Edit_Click(object sender, EventArgs e)
 {
     if (CLB_Skill_Trees.CheckedItems.Count > 1)
     {
         MessageBox.Show($"You can only edit one item at a time", "Error, Only select one item", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     else if (CLB_Skill_Trees.CheckedItems.Count < 1)
     {
         MessageBox.Show($"You must select an item to edit", "Error, Select atleast one item", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     else
     {
         var item = CLB_Skill_Trees.CheckedItems.OfType <SkillTree>().Single();
         CLB_Skill_Trees.Items.Remove(item);
         var tmp = new SkillTrees(item, CLB_Skills.Items.OfType <CustomSkill>().ToArray());
         this.Visible = false;
         tmp.Show();
         tmp.Focus();
         tmp.FormClosing += SkillTree_FormClosing;
     }
 }