C# Класс Nexus.Client.PluginManagement.PluginManager

The class the encapsulates managing plugins.
The list of managed plugins needs to be centralized to ensure integrity; having multiple managers, each with a potentially different list of managed plugins, would be disastrous. As such, this object is a singleton to help enforce that policy. Note, however, that the singleton nature of the manager is not meant to provide global access to the object. As such, there is no static accessor to retrieve the singleton instance. Instead, the Initialize method returns the only instance that should be used.
Наследование: IPluginManager
Показать файл Открыть проект

Открытые методы

Метод Описание
ActivatePlugin ( Plugin p_plgPlugin ) : void

Activates the given plugin.

ActivatePlugin ( string p_strPath ) : void

Activates the specified plugin.

AddPlugin ( string p_strPluginPath ) : bool

Adds the specified plugin to the list of managed plugins.

AutoPluginSorting ( ConfirmActionMethod p_camConfirm ) : IBackgroundTask

Automatically sorts the managed plugins.

CanActivatePlugins ( ) : bool

Determines if the game mode can handle more active plugins.

CanChangeActiveState ( Plugin p_plgPlugin ) : bool

Determines if the active state of the given plugin can be changed.

DeactivatePlugin ( Plugin p_plgPlugin ) : void

Deactivates the given plugin.

DeactivatePlugin ( string p_strPath ) : void

Deactivates the specified plugin.

GetPluginOrderIndex ( Plugin p_plgPlugin ) : Int32

Gets the load order of the specifid plugin.

GetRegisteredPlugin ( string p_strPath ) : Plugin

Gets the specified plugin.

Initialize ( IGameMode p_gmdGameMode, PluginRegistry p_mprManagedPluginRegistry, ActivePluginLog p_aplPluginLog, IPluginOrderLog p_polOrderLog, IPluginOrderValidator p_povOrderValidator ) : IPluginManager

Initializes the singleton intances of the mod manager.

IsActivatiblePluginFile ( string p_strPath ) : bool

Determines if the specified file is a plugin that can be activated for the game mode.

IsPluginActive ( string p_strPath ) : bool

Determines if the specified plugin is active.

IsPluginRegistered ( string p_strPath ) : bool

Determines if the specified plugin is registered.

ManageMultiplePluginsTask ( List p_lstPlugins, bool p_booEnable, ConfirmActionMethod p_camConfirm ) : IBackgroundTask

Runs the managed updaters.

Release ( ) : void

This disposes of the singleton object, allowing it to be re-initialized.

RemovePlugin ( Plugin p_plgPlugin ) : void

Removes the given plugin from the list of managed plugins.

RemovePlugin ( string p_strPluginPath ) : void

Removes the specified plugin from the list of managed plugins.

SetPluginActivation ( string p_strPath, bool p_booActive ) : void

Sets the activations status of the specified plugin.

SetPluginOrder ( IList p_lstOrderedPlugins ) : void

Sets the order of the plugins to the given order.

If the given list does not include all registered plugins, then the plugins are ordered in a manner so as to not displace the positions of the plugins whose order was not specified.

SetPluginOrderIndex ( Plugin p_plgPlugin, int p_intNewIndex ) : void

Sets the load order of the specifid plugin.

ValidateOrder ( IList p_lstPlugins ) : bool

Determines if the specified plugin order is valid.

Приватные методы

Метод Описание
PluginManager ( IGameMode p_gmdGameMode, PluginRegistry p_mprManagedPluginRegistry, ActivePluginLog p_aplPluginLog, IPluginOrderLog p_polOrderLog, IPluginOrderValidator p_povOrderValidator ) : System

A simple constructor that initializes the object with its dependencies.

Описание методов

ActivatePlugin() публичный Метод

Activates the given plugin.
public ActivatePlugin ( Plugin p_plgPlugin ) : void
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin to activate.
Результат void

ActivatePlugin() публичный Метод

Activates the specified plugin.
public ActivatePlugin ( string p_strPath ) : void
p_strPath string The path to the plugin to activate.
Результат void

AddPlugin() публичный Метод

Adds the specified plugin to the list of managed plugins.
public AddPlugin ( string p_strPluginPath ) : bool
p_strPluginPath string The path to the plugin to add.
Результат bool

AutoPluginSorting() публичный Метод

Automatically sorts the managed plugins.
public AutoPluginSorting ( ConfirmActionMethod p_camConfirm ) : IBackgroundTask
p_camConfirm ConfirmActionMethod The delegate to call to confirm an action.
Результат IBackgroundTask

CanActivatePlugins() публичный Метод

Determines if the game mode can handle more active plugins.
public CanActivatePlugins ( ) : bool
Результат bool

CanChangeActiveState() публичный Метод

Determines if the active state of the given plugin can be changed.
public CanChangeActiveState ( Plugin p_plgPlugin ) : bool
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin for which it is to be determined if the active state can be changed.
Результат bool

DeactivatePlugin() публичный Метод

Deactivates the given plugin.
public DeactivatePlugin ( Plugin p_plgPlugin ) : void
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin to deactivate.
Результат void

DeactivatePlugin() публичный Метод

Deactivates the specified plugin.
public DeactivatePlugin ( string p_strPath ) : void
p_strPath string The path to the plugin to deactivate.
Результат void

GetPluginOrderIndex() публичный Метод

Gets the load order of the specifid plugin.
public GetPluginOrderIndex ( Plugin p_plgPlugin ) : Int32
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin whose load order is to be returned.
Результат System.Int32

GetRegisteredPlugin() публичный Метод

Gets the specified plugin.
public GetRegisteredPlugin ( string p_strPath ) : Plugin
p_strPath string The path of the plugin to retrieve.
Результат Nexus.Client.Plugins.Plugin

Initialize() публичный статический Метод

Initializes the singleton intances of the mod manager.
Thrown if the plugin manager has already /// been initialized.
public static Initialize ( IGameMode p_gmdGameMode, PluginRegistry p_mprManagedPluginRegistry, ActivePluginLog p_aplPluginLog, IPluginOrderLog p_polOrderLog, IPluginOrderValidator p_povOrderValidator ) : IPluginManager
p_gmdGameMode IGameMode The current game mode.
p_mprManagedPluginRegistry PluginRegistry The that contains the list /// of managed s.
p_aplPluginLog Nexus.Client.PluginManagement.InstallationLog.ActivePluginLog The tracking plugin activations for the /// current game mode.
p_polOrderLog IPluginOrderLog The tracking plugin order for the /// current game mode.
p_povOrderValidator IPluginOrderValidator The object that validates plugin order.
Результат IPluginManager

IsActivatiblePluginFile() публичный Метод

Determines if the specified file is a plugin that can be activated for the game mode.
public IsActivatiblePluginFile ( string p_strPath ) : bool
p_strPath string The path to the file for which it is to be determined if it is a plugin file.
Результат bool

IsPluginActive() публичный Метод

Determines if the specified plugin is active.
public IsPluginActive ( string p_strPath ) : bool
p_strPath string The path to the plugin whose active status is to be determined.
Результат bool

IsPluginRegistered() публичный Метод

Determines if the specified plugin is registered.
public IsPluginRegistered ( string p_strPath ) : bool
p_strPath string The path to the plugin whose registration status is to be determined.
Результат bool

ManageMultiplePluginsTask() публичный Метод

Runs the managed updaters.
public ManageMultiplePluginsTask ( List p_lstPlugins, bool p_booEnable, ConfirmActionMethod p_camConfirm ) : IBackgroundTask
p_lstPlugins List
p_booEnable bool Enable/Disable/Toggle.
p_camConfirm ConfirmActionMethod The delegate to call to confirm an action.
Результат IBackgroundTask

Release() публичный Метод

This disposes of the singleton object, allowing it to be re-initialized.
public Release ( ) : void
Результат void

RemovePlugin() публичный Метод

Removes the given plugin from the list of managed plugins.
public RemovePlugin ( Plugin p_plgPlugin ) : void
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin to remove.
Результат void

RemovePlugin() публичный Метод

Removes the specified plugin from the list of managed plugins.
public RemovePlugin ( string p_strPluginPath ) : void
p_strPluginPath string The path to the plugin to remove.
Результат void

SetPluginActivation() публичный Метод

Sets the activations status of the specified plugin.
public SetPluginActivation ( string p_strPath, bool p_booActive ) : void
p_strPath string The path to the plugin whose status is to be set.
p_booActive bool Whether to activate the plugin, or deactivate it.
Результат void

SetPluginOrder() публичный Метод

Sets the order of the plugins to the given order.
If the given list does not include all registered plugins, then the plugins are ordered in a manner so as to not displace the positions of the plugins whose order was not specified.
public SetPluginOrder ( IList p_lstOrderedPlugins ) : void
p_lstOrderedPlugins IList The list indicating the desired order of the plugins.
Результат void

SetPluginOrderIndex() публичный Метод

Sets the load order of the specifid plugin.
public SetPluginOrderIndex ( Plugin p_plgPlugin, int p_intNewIndex ) : void
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin whose load order is to be set.
p_intNewIndex int The new load order index of the plugin.
Результат void

ValidateOrder() публичный Метод

Determines if the specified plugin order is valid.
public ValidateOrder ( IList p_lstPlugins ) : bool
p_lstPlugins IList The plugins whose order is to be validated.
Результат bool