/// <summary> /// Deactivates the specified plugin. /// </summary> /// <param name="p_strPath">The path to the plugin to deactivate.</param> public void DeactivatePlugin(string p_strPath) { string strPath = p_strPath; if (!Path.IsPathRooted(p_strPath)) { strPath = Path.Combine(GameMode.GameModeEnvironmentInfo.InstallationPath, p_strPath); } ActivePluginLog.DeactivatePlugin(strPath); }
/// <summary> /// A simpell constructor that initializes the object with the given services. /// </summary> /// <param name="p_ilgModInstallLog">The install log that tracks mod install info for the current game mode.</param> /// <param name="p_aplActivePluginLog">The <see cref="ActivePluginLog"/> tracking plugin activations for the current game mode.</param> /// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param> /// <param name="p_mrpModRepository">The repository we are logging in to.</param> /// <param name="p_mmgModManager">The mod manager to use to manage mods.</param> /// <param name="p_pmgPluginManager">The manager to use to manage plugins.</param> /// <param name="p_amtMonitor">The download monitor to use to manage the monitored activities.</param> /// <param name="p_mamMonitor">The mod activation monitor to use to manage the monitored activities.</param> /// <param name="p_umgUpdateManager">The update manager to use to perform updates.</param> public ServiceManager(IInstallLog p_ilgModInstallLog, ActivePluginLog p_aplActivePluginLog, IPluginOrderLog p_polPluginOrderLog, IModRepository p_mrpModRepository, ModManager p_mmgModManager, IPluginManager p_pmgPluginManager, DownloadMonitor p_amtMonitor, ModActivationMonitor p_mamMonitor) { ModInstallLog = p_ilgModInstallLog; ActivePluginLog = p_aplActivePluginLog; PluginOrderLog = p_polPluginOrderLog; ModRepository = p_mrpModRepository; ModManager = p_mmgModManager; PluginManager = p_pmgPluginManager; DownloadMonitor = p_amtMonitor; ModActivationMonitor = p_mamMonitor; }
/// <summary> /// A simple constructor that initializes the object with its dependencies. /// </summary> /// <param name="p_gmdGameMode">The current game mode.</param> /// <param name="p_mprManagedPluginRegistry">The <see cref="PluginRegistry"/> that contains the list /// of managed <see cref="Plugin"/>s.</param> /// <param name="p_aplPluginLog">The <see cref="ActivePluginLog"/> tracking plugin activations for the /// current game mode.</param> /// <param name="p_polOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the /// current game mode.</param> /// <param name="p_povOrderValidator">The object that validates plugin order.</param> private PluginManager(IGameMode p_gmdGameMode, PluginRegistry p_mprManagedPluginRegistry, ActivePluginLog p_aplPluginLog, IPluginOrderLog p_polOrderLog, IPluginOrderValidator p_povOrderValidator) { GameMode = p_gmdGameMode; ManagedPluginRegistry = p_mprManagedPluginRegistry; ActivePluginLog = p_aplPluginLog; PluginOrderLog = p_polOrderLog; OrderValidator = p_povOrderValidator; if (GameMode.OrderedCriticalPluginNames != null) { foreach (string strPlugin in GameMode.OrderedCriticalPluginNames) { ActivePluginLog.ActivatePlugin(strPlugin); } List <Plugin> lstPlugins = new List <Plugin>(PluginOrderLog.OrderedPlugins); if (!OrderValidator.ValidateOrder(lstPlugins)) { OrderValidator.CorrectOrder(lstPlugins); PluginOrderLog.SetPluginOrder(lstPlugins); } } }
/// <summary> /// Initializes the singleton intances of the mod manager. /// </summary> /// <param name="p_gmdGameMode">The current game mode.</param> /// <param name="p_mprManagedPluginRegistry">The <see cref="PluginRegistry"/> that contains the list /// of managed <see cref="Plugin"/>s.</param> /// <param name="p_aplPluginLog">The <see cref="ActivePluginLog"/> tracking plugin activations for the /// current game mode.</param> /// <param name="p_polOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the /// current game mode.</param> /// <param name="p_povOrderValidator">The object that validates plugin order.</param> /// <exception cref="InvalidOperationException">Thrown if the plugin manager has already /// been initialized.</exception> public static IPluginManager Initialize(IGameMode p_gmdGameMode, PluginRegistry p_mprManagedPluginRegistry, ActivePluginLog p_aplPluginLog, IPluginOrderLog p_polOrderLog, IPluginOrderValidator p_povOrderValidator) { if (m_pmgCurrent != null) { throw new InvalidOperationException("The Plugin Manager has already been initialized."); } m_pmgCurrent = new PluginManager(p_gmdGameMode, p_mprManagedPluginRegistry, p_aplPluginLog, p_polOrderLog, p_povOrderValidator); return(m_pmgCurrent); }
/// <summary> /// Deactivates the given plugin. /// </summary> /// <param name="p_plgPlugin">The plugin to deactivate.</param> public void DeactivatePlugin(Plugin p_plgPlugin) { ActivePluginLog.DeactivatePlugin(p_plgPlugin); }
/// <summary> /// Removes the given plugin from the list of managed plugins. /// </summary> /// <param name="p_plgPlugin">The plugin to remove.</param> public void RemovePlugin(Plugin p_plgPlugin) { ActivePluginLog.DeactivatePlugin(p_plgPlugin); PluginOrderLog.RemovePlugin(p_plgPlugin); ManagedPluginRegistry.UnregisterPlugin(p_plgPlugin); }
/// <summary> /// A simple constructor that initializes the object with its dependencies. /// </summary> public ManageMultiplePluginsTask(List <Plugin> p_lstPlugins, ActivePluginLog p_aplLog, bool p_booEnable) { PluginList = p_lstPlugins; APL = p_aplLog; EnablePlugins = p_booEnable; }