Пример #1
0
        /// <summary>
        ///   Handles the <see cref="ListView.DragDrop" /> event of the installer list view.
        /// </summary>
        /// <remarks>
        ///   This method changes the order of the currently selected file's installers.
        /// </remarks>
        /// <param name="sender">The object that triggered the event</param>
        /// <param name="e">A <see cref="TreeViewEventArgs" /> describing the event arguments.</param>
        private void rlvOverwrites_DragDrop(object sender, DragEventArgs e)
        {
            var lstOrderedMods = new List <string>();

            foreach (ListViewItem lviMod in rlvOverwrites.Items)
            {
                lstOrderedMods.Add(lviMod.Text);
            }

            var strFile      = (string)lvwFiles.SelectedItems[0].Tag;
            var mirReorderer = new ModInstallReorderer();

            if (!mirReorderer.ReorderFileInstallers(strFile, lstOrderedMods))
            {
                loadInstallingMods();
            }
            else
            {
                for (var i = rlvOverwrites.Items.Count - 2; i >= 0; i--)
                {
                    rlvOverwrites.Items[i].BackColor = SystemColors.Window;
                }
                rlvOverwrites.Items[rlvOverwrites.Items.Count - 1].BackColor = Color.LightGreen;
            }
        }
Пример #2
0
        /// <summary>
        /// Handles the <see cref="ListView.DragDrop"/> event of the installer list view.
        /// </summary>
        /// <remarks>
        /// This method changes the order of the currently selected file's installers.
        /// </remarks>
        /// <param name="sender">The object that triggered the event</param>
        /// <param name="e">A <see cref="TreeViewEventArgs"/> describing the event arguments.</param>
        private void rlvOverwrites_DragDrop(object sender, DragEventArgs e)
        {
            List<string> lstOrderedMods = new List<string>();
            foreach (ListViewItem lviMod in rlvOverwrites.Items)
                lstOrderedMods.Add(lviMod.Text);

            string strFile = (string)lvwFiles.SelectedItems[0].Tag;
            ModInstallReorderer mirReorderer = new ModInstallReorderer();
            if (!mirReorderer.ReorderFileInstallers(strFile, lstOrderedMods))
                loadInstallingMods();
            else
            {
                for (Int32 i = rlvOverwrites.Items.Count - 2; i >= 0; i--)
                    rlvOverwrites.Items[i].BackColor = SystemColors.Window;
                rlvOverwrites.Items[rlvOverwrites.Items.Count - 1].BackColor = Color.LightGreen;
            }
        }