void btnAdd_Click(object sender, EventArgs e)

        {
            EnhancementSet iSet          = new EnhancementSet();
            frmSetEditPvP  frmSetEditPvP = new frmSetEditPvP(ref iSet);
            int            num           = (int)frmSetEditPvP.ShowDialog();

            if (frmSetEditPvP.DialogResult != DialogResult.OK)
            {
                return;
            }
            DatabaseAPI.Database.EnhancementSets.Add(new EnhancementSet(frmSetEditPvP.mySet));
            ImageUpdate();
            AddListItem(DatabaseAPI.Database.EnhancementSets.Count - 1);
        }
        void btnClone_Click(object sender, EventArgs e)

        {
            if (lvSets.SelectedIndices.Count <= 0)
            {
                return;
            }
            EnhancementSet iSet = new EnhancementSet(DatabaseAPI.Database.EnhancementSets[lvSets.SelectedIndices[0]]);

            iSet.DisplayName += " Copy";
            frmSetEditPvP frmSetEditPvP = new frmSetEditPvP(ref iSet);
            int           num           = (int)frmSetEditPvP.ShowDialog();

            if (frmSetEditPvP.DialogResult != DialogResult.OK)
            {
                return;
            }
            DatabaseAPI.Database.EnhancementSets.Add(new EnhancementSet(frmSetEditPvP.mySet));
            ImageUpdate();
            AddListItem(DatabaseAPI.Database.EnhancementSets.Count - 1);
        }
        void btnEdit_Click(object sender, EventArgs e)

        {
            if (lvSets.SelectedIndices.Count <= 0)
            {
                return;
            }
            bool   flag           = false;
            string uidOld         = "";
            int    selectedIndex1 = lvSets.SelectedIndices[0];
            EnhancementSetCollection enhancementSets = DatabaseAPI.Database.EnhancementSets;
            int selectedIndex2 = this.lvSets.SelectedIndices[0];

            /*string setName = Regex.Replace(lvSets.SelectedItems[0].Text, @"( \(\w+\))", "");
             * var setNameIndex = enhancementSets.FindIndex(x => x.DisplayName == setName);*/
            EnhancementSet iSet = enhancementSets[selectedIndex2];

            enhancementSets[selectedIndex2] = iSet;
            frmSetEditPvP frmSetEditPvP = new frmSetEditPvP(ref iSet);
            int           num           = (int)frmSetEditPvP.ShowDialog();

            if (frmSetEditPvP.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (frmSetEditPvP.mySet.Uid != DatabaseAPI.Database.EnhancementSets[lvSets.SelectedIndices[0]].Uid)
            {
                flag   = true;
                uidOld = DatabaseAPI.Database.EnhancementSets[lvSets.SelectedIndices[0]].Uid;
            }
            DatabaseAPI.Database.EnhancementSets[lvSets.SelectedIndices[0]] = new EnhancementSet(frmSetEditPvP.mySet);
            ImageUpdate();
            UpdateListItem(selectedIndex1);
            if (!flag)
            {
                return;
            }
            RenameIOSet(uidOld, frmSetEditPvP.mySet.Uid);
            DatabaseAPI.MatchEnhancementIDs();
        }