예제 #1
0
        void btnClone_Click(object sender, EventArgs e)
        {
            if (lvEnh.SelectedIndices.Count <= 0)
            {
                return;
            }
            IEnhancement oldEnhancement = DatabaseAPI.Database.Enhancements[DatabaseAPI.GetEnhancementByUIDName(lvEnh.SelectedItems[0].SubItems[5].Text)];
            frmEnhData   frmEnhData     = new frmEnhData(ref oldEnhancement, DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1].StaticIndex + 1);
            int          num            = (int)frmEnhData.ShowDialog();

            if (frmEnhData.DialogResult != DialogResult.OK)
            {
                return;
            }
            IDatabase database = DatabaseAPI.Database;

            IEnhancement[] enhancementArray = (IEnhancement[])Utils.CopyArray(database.Enhancements, new IEnhancement[DatabaseAPI.Database.Enhancements.Length + 1]);
            database.Enhancements = enhancementArray;
            DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1] =
                new Enhancement(frmEnhData.myEnh)
            {
                IsNew = true, StaticIndex = -1
            };
            ImageUpdate();
            AddListItem(DatabaseAPI.Database.Enhancements.Length - 1);
        }
예제 #2
0
        void btnAdd_Click(object sender, EventArgs e)
        {
            IEnhancement iEnh       = new Enhancement();
            frmEnhData   frmEnhData = new frmEnhData(ref iEnh, DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1].StaticIndex + 1);
            int          num        = (int)frmEnhData.ShowDialog();

            if (frmEnhData.DialogResult != DialogResult.OK)
            {
                return;
            }
            IDatabase database = DatabaseAPI.Database;

            IEnhancement[] enhancementArray = (IEnhancement[])Utils.CopyArray(database.Enhancements, new IEnhancement[DatabaseAPI.Database.Enhancements.Length + 1]);
            database.Enhancements = enhancementArray;
            Enhancement newEnhancement = new Enhancement(frmEnhData.myEnh)
            {
                IsNew = true
            };

            DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1] = newEnhancement;
            if (newEnhancement.nIDSet > 0)
            {
                EnhancementSet es = DatabaseAPI.Database.EnhancementSets[newEnhancement.nIDSet];
                Array.Resize(ref es.Enhancements, es.Enhancements.Length + 1);
                es.Enhancements[es.Enhancements.Length - 1] = newEnhancement.StaticIndex;
            }
            ImageUpdate();
            AddListItem(DatabaseAPI.Database.Enhancements.Length - 1);
        }
예제 #3
0
 void btnEdit_Click(object sender, EventArgs e)
 {
     if (this.lvEnh.SelectedIndices.Count > 0)
     {
         int        selectedIndex = this.lvEnh.SelectedIndices[0];
         frmEnhData frmEnhData    = new frmEnhData(ref DatabaseAPI.Database.Enhancements[this.lvEnh.SelectedIndices[0]]);
         frmEnhData.ShowDialog();
         if (frmEnhData.DialogResult == DialogResult.OK)
         {
             DatabaseAPI.Database.Enhancements[this.lvEnh.SelectedIndices[0]]            = new Enhancement(frmEnhData.myEnh);
             DatabaseAPI.Database.Enhancements[this.lvEnh.SelectedIndices[0]].IsModified = true;
             this.ImageUpdate();
             this.UpdateListItem(selectedIndex);
         }
     }
 }
예제 #4
0
        void btnAdd_Click(object sender, EventArgs e)
        {
            IEnhancement iEnh       = new Enhancement();
            frmEnhData   frmEnhData = new frmEnhData(ref iEnh);

            frmEnhData.ShowDialog();
            if (frmEnhData.DialogResult == DialogResult.OK)
            {
                IDatabase      database         = DatabaseAPI.Database;
                IEnhancement[] enhancementArray = (IEnhancement[])Utils.CopyArray(database.Enhancements, new IEnhancement[DatabaseAPI.Database.Enhancements.Length + 1]);
                database.Enhancements = enhancementArray;
                DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1]             = new Enhancement(frmEnhData.myEnh);
                DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1].IsNew       = true;
                DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1].StaticIndex = -1;
                this.ImageUpdate();
                this.AddListItem(DatabaseAPI.Database.Enhancements.Length - 1);
            }
        }
        void btnClone_Click(object sender, EventArgs e)
        {
            if (this.lvEnh.SelectedIndices.Count <= 0)
            {
                return;
            }
            frmEnhData frmEnhData = new frmEnhData(ref DatabaseAPI.Database.Enhancements[this.lvEnh.SelectedIndices[0]]);
            int        num        = (int)frmEnhData.ShowDialog();

            if (frmEnhData.DialogResult == DialogResult.OK)
            {
                IDatabase      database         = DatabaseAPI.Database;
                IEnhancement[] enhancementArray = (IEnhancement[])Utils.CopyArray(database.Enhancements, new IEnhancement[DatabaseAPI.Database.Enhancements.Length + 1]);
                database.Enhancements = enhancementArray;
                DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1]             = (IEnhancement) new Enhancement(frmEnhData.myEnh);
                DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1].IsNew       = true;
                DatabaseAPI.Database.Enhancements[DatabaseAPI.Database.Enhancements.Length - 1].StaticIndex = -1;
                this.ImageUpdate();
                this.AddListItem(DatabaseAPI.Database.Enhancements.Length - 1);
            }
        }
예제 #6
0
        void btnEdit_Click(object sender, EventArgs e)
        {
            if (lvEnh.SelectedIndices.Count <= 0)
            {
                return;
            }
            int        selectedIndex = lvEnh.SelectedIndices[0];
            frmEnhData frmEnhData    = new frmEnhData(ref DatabaseAPI.Database.Enhancements[lvEnh.SelectedIndices[0]]);
            int        num           = (int)frmEnhData.ShowDialog();

            if (frmEnhData.DialogResult != DialogResult.OK)
            {
                return;
            }
            DatabaseAPI.Database.Enhancements[lvEnh.SelectedIndices[0]] =
                new Enhancement(frmEnhData.myEnh)
            {
                IsModified = true
            };
            ImageUpdate();
            UpdateListItem(selectedIndex);
        }
예제 #7
0
        void btnEdit_Click(object sender, EventArgs e)
        {
            if (lvEnh.SelectedIndices.Count <= 0)
            {
                return;
            }
            int        selectedIndex = DatabaseAPI.GetEnhancementByUIDName(lvEnh.SelectedItems[0].SubItems[5].Text);
            frmEnhData frmEnhData    = new frmEnhData(ref DatabaseAPI.Database.Enhancements[selectedIndex], 0);
            int        num           = (int)frmEnhData.ShowDialog();

            if (frmEnhData.DialogResult != DialogResult.OK)
            {
                return;
            }
            Enhancement newEnhancement = new Enhancement(frmEnhData.myEnh)
            {
                IsModified = true
            };

            DatabaseAPI.Database.Enhancements[lvEnh.SelectedIndices[0]] = newEnhancement;
            ImageUpdate();
            UpdateListItem(selectedIndex);
        }