예제 #1
0
        void btnEdit_Click(object sender, EventArgs e)

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

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

            if (frmSetEdit.DialogResult == DialogResult.OK)
            {
                if (frmSetEdit.mySet.Uid != DatabaseAPI.Database.EnhancementSets[this.lvSets.SelectedIndices[0]].Uid)
                {
                    flag   = true;
                    uidOld = DatabaseAPI.Database.EnhancementSets[this.lvSets.SelectedIndices[0]].Uid;
                }
                DatabaseAPI.Database.EnhancementSets[this.lvSets.SelectedIndices[0]] = new EnhancementSet(frmSetEdit.mySet);
                this.ImageUpdate();
                this.UpdateListItem(selectedIndex1);
                if (flag)
                {
                    frmSetListing.RenameIOSet(uidOld, frmSetEdit.mySet.Uid);
                    DatabaseAPI.MatchEnhancementIDs();
                }
            }
        }
예제 #2
0
 void lstSets_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.lstSets.SelectedItems.Count >= 1)
     {
         this.rtxtInfo.Rtf = RTF.StartRTF() + EnhancementSetCollection.GetSetInfoLongRTF(Conversions.ToInteger(this.lstSets.SelectedItems[0].Tag), Conversions.ToInteger(this.lstSets.SelectedItems[0].SubItems[2].Text)) + RTF.EndRTF();
     }
 }
 void lstSets_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lstSets.SelectedItems.Count < 1)
     {
         return;
     }
     rtxtInfo.Rtf = RTF.StartRTF() + EnhancementSetCollection.GetSetInfoLongRTF(Convert.ToInt32(lstSets.SelectedItems[0].Tag),
                                                                                Convert.ToInt32(lstSets.SelectedItems[0].SubItems[2].Text)) + RTF.EndRTF();
 }
예제 #4
0
        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;
            frmSetEdit frmSetEdit = new frmSetEdit(ref iSet);
            int        num        = (int)frmSetEdit.ShowDialog();

            if (frmSetEdit.DialogResult != DialogResult.OK)
            {
                return;
            }
            if (frmSetEdit.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(frmSetEdit.mySet);
            ImageUpdate();
            UpdateListItem(selectedIndex1);
            if (!flag)
            {
                return;
            }
            RenameIOSet(uidOld, frmSetEdit.mySet.Uid);
            DatabaseAPI.MatchEnhancementIDs();
        }