示例#1
0
        /// <summary>
        ///   Activates, Reactivates, or Deactivates the selected mod as appropriate.
        /// </summary>
        /// <param name="mod">The mod to act upon.</param>
        /// <param name="p_booReactivate">If this is a reativation request.</param>
        private void ToggleActivation(fomod mod, bool p_booReactivate)
        {
            if (!mod.IsActive)
            {
                ActivateFomod(mod);
            }
            else if (p_booReactivate)
            {
                var mraReactivator = new ModReactivator(mod);
                mraReactivator.Upgrade();
            }
            else
            {
                var mduUninstaller = new ModUninstaller(mod);
                mduUninstaller.Uninstall();
            }
            if (cbGroups.Checked)
            {
                foreach (ListViewItem lvi in lvModList.Items)
                {
                    if (lvi.Tag == mod)
                    {
                        lvi.Checked = mod.IsActive;
                    }
                }
            }
            else
            {
                lvModList.SelectedItems[0].Checked = mod.IsActive;
            }
            butDeactivate.Enabled = mod.IsActive;
            bActivate.Text        = !mod.IsActive ? "Activate" : "Reactivate";

            mf.RefreshPluginList();
        }
示例#2
0
        /// <summary>
        /// Activates, Reactivates, or Deactivates the selected mod as appropriate.
        /// </summary>
        /// <param name="mod">The mod to act upon.</param>
        /// <param name="p_booReactivate">If this is a reativation request.</param>
        private void ToggleActivation(fomod mod, bool p_booReactivate)
        {
            if (!mod.IsActive)
            {
                ActivateFomod(mod);
            }
            else if (p_booReactivate)
            {
                ModReactivator mraReactivator = new ModReactivator(mod);
                mraReactivator.Upgrade();
            }
            else
            {
                ModUninstaller mduUninstaller = new ModUninstaller(mod);
                mduUninstaller.Uninstall();
            }
            if (cbGroups.Checked)
            {
                foreach (ListViewItem lvi in lvModList.Items)
                {
                    if (lvi.Tag == mod) lvi.Checked = mod.IsActive;
                }
            }
            else
            {
                lvModList.SelectedItems[0].Checked = mod.IsActive;
            }
            butDeactivate.Enabled = mod.IsActive;
            if (!mod.IsActive) bActivate.Text = "Activate";
            else bActivate.Text = "Reactivate";

            mf.RefreshPluginList();
        }