C# Класс Nexus.Client.ModManagement.ModManager

The class the encapsulates managing mods.
The list of managed mods needs to be centralized to ensure integrity; having multiple mod managers, each with a potentially different list of managed mods, 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
IsBackupActive bool
LoginTask LoginFormTask
lstMBInfo List

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

Метод Описание
ActivateMod ( IMod p_modMod, ConfirmModUpgradeDelegate p_dlgUpgradeConfirmationDelegate, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate, ReadOnlyObservableList p_rolActiveMods ) : IBackgroundTaskSet

Activates the given mod.

AddMod ( string p_strPath, ConfirmOverwriteCallback p_cocConfirmOverwrite ) : IBackgroundTask

Installs the specified mod.

AsyncAddMod ( Uri p_uriPath, ConfirmOverwriteCallback p_cocConfirmOverwrite ) : IBackgroundTask
AsyncAddModTask ( IBackgroundTask p_tskAddModTask ) : void
AsyncEndorseMod ( IMod p_modMod ) : void

Async toggle of the endorsement for the given mod.

AsyncTagMod ( ModManagement p_ModManagerVM, ModManagement p_ModTaggerVM, EventHandler p_TaggingMod ) : void
AsyncUpdateMods ( List p_lstModList, ConfirmActionMethod p_camConfirm, bool p_booOverrideCategorySetup ) : void

Runs the managed updaters.

AsyncUpdateModsTask ( ModUpdateCheckTask p_mutModUpdateCheck, ConfirmActionMethod p_camConfirm ) : Task
DeactivateMod ( IMod p_modMod, ReadOnlyObservableList p_rolActiveMods ) : IBackgroundTaskSet

deactivates the given mod.

DeactivateMultipleMods ( ReadOnlyObservableList p_rolModList, ConfirmActionMethod p_camConfirm ) : IBackgroundTask

Runs the managed updaters.

DeleteMod ( IMod p_modMod, ReadOnlyObservableList p_rolActiveMods ) : IBackgroundTaskSet

Deletes the given mod.

The mod is deactivated, unregistered, and then deleted.

ForceUpgrade ( IMod p_modOldMod, IMod p_modNewMod, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : IBackgroundTaskSet

Forces an upgrade from one mod to another.

No checks as to whether the two mods are actually related are performed. The new mod is reactivated as if it were the old mod, and the old mod is replaced by the new mod.

GetModTagger ( ) : AutoTagger

Gets the tagger to use to tag mods with metadata.

Initialize ( IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, IModRepository p_mrpModRepository, DownloadMonitor p_dmrMonitor, ActivateModsMonitor p_ammMonitor, IModFormatRegistry p_frgFormatRegistry, ModRegistry p_mrgModRegistry, FileUtil p_futFileUtility, SynchronizationContext p_scxUIContext, IInstallLog p_ilgInstallLog, IPluginManager p_pmgPluginManager ) : ModManager

Initializes the singleton intances of the mod manager.

LoadQueuedMods ( ) : void

Loads the list of mods that are queued to be added to the mod manager.

Login ( ) : bool

Logins the user into the current mod repository.

Logout ( ) : void
ReactivateMod ( IMod p_modMod, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : IBackgroundTaskSet

Reactivates the given mod.

A reactivation is an upgrade of a mod to itself. It re-runs the activation, without changing the installed precedence of its files and installed values.

Release ( ) : void

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

SetupReadMeManager ( List p_lstModList, ConfirmActionMethod p_camConfirm ) : IBackgroundTask

Runs the managed updaters.

SwitchModCategory ( IMod p_modMod, Int32 p_intCategoryId ) : void

Switches the mod category.

ToggleModEndorsement ( IMod p_modMod ) : void

Toggles the endorsement for the given mod.

ToggleUpdateWarningTask ( HashSet p_hashMods, bool p_booEnable, ConfirmActionMethod p_camConfirm ) : IBackgroundTask

Runs the managed updaters.

UpdateMods ( List p_lstModList, ConfirmActionMethod p_camConfirm, bool p_booOverrideCategorySetup ) : IBackgroundTask

Runs the managed updaters.

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

Метод Описание
Deactivator_TaskSetCompleted ( object sender, TaskSetCompletedEventArgs e ) : void

Handles the IBackgroundTaskSet.TaskSetCompleted event of the mod deletion mod deativator.

DeleteXMLInstalledFile ( IMod p_modMod ) : void

If the mod is scripted, deletes the XMLInstalledFiles file inside the InstallInfo\Scripted folder.

ModManager ( IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, IModRepository p_mrpModRepository, DownloadMonitor p_dmrMonitor, ActivateModsMonitor p_ammMonitor, IModFormatRegistry p_frgFormatRegistry, ModRegistry p_mdrManagedModRegistry, FileUtil p_futFileUtility, SynchronizationContext p_scxUIContext, IInstallLog p_ilgInstallLog, IPluginManager p_pmgPluginManager ) : System

A simple constructor that initializes the object with its dependencies.

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

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

Activates the given mod.
public ActivateMod ( IMod p_modMod, ConfirmModUpgradeDelegate p_dlgUpgradeConfirmationDelegate, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate, ReadOnlyObservableList p_rolActiveMods ) : IBackgroundTaskSet
p_modMod IMod The mod to activate.
p_dlgUpgradeConfirmationDelegate ConfirmModUpgradeDelegate The delegate that is called to confirm whether an upgrade install should be performed.
p_dlgOverwriteConfirmationDelegate ConfirmItemOverwriteDelegate The method to call in order to confirm an overwrite.
p_rolActiveMods ReadOnlyObservableList The list or Active mods.
Результат IBackgroundTaskSet

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

Installs the specified mod.
public AddMod ( string p_strPath, ConfirmOverwriteCallback p_cocConfirmOverwrite ) : IBackgroundTask
p_strPath string The path to the mod to install.
p_cocConfirmOverwrite ConfirmOverwriteCallback The delegate to call to resolve conflicts with existing files.
Результат IBackgroundTask

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

public AsyncAddMod ( Uri p_uriPath, ConfirmOverwriteCallback p_cocConfirmOverwrite ) : IBackgroundTask
p_uriPath System.Uri
p_cocConfirmOverwrite ConfirmOverwriteCallback
Результат IBackgroundTask

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

public AsyncAddModTask ( IBackgroundTask p_tskAddModTask ) : void
p_tskAddModTask IBackgroundTask
Результат void

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

Async toggle of the endorsement for the given mod.
public AsyncEndorseMod ( IMod p_modMod ) : void
p_modMod IMod The mod to endorse/unendorse.
Результат void

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

public AsyncTagMod ( ModManagement p_ModManagerVM, ModManagement p_ModTaggerVM, EventHandler p_TaggingMod ) : void
p_ModManagerVM ModManagement
p_ModTaggerVM ModManagement
p_TaggingMod EventHandler
Результат void

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

Runs the managed updaters.
public AsyncUpdateMods ( List p_lstModList, ConfirmActionMethod p_camConfirm, bool p_booOverrideCategorySetup ) : void
p_lstModList List The list of mods we need to update.
p_camConfirm ConfirmActionMethod The delegate to call to confirm an action.
p_booOverrideCategorySetup bool Whether to force a global update.
Результат void

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

public AsyncUpdateModsTask ( ModUpdateCheckTask p_mutModUpdateCheck, ConfirmActionMethod p_camConfirm ) : Task
p_mutModUpdateCheck ModUpdateCheckTask
p_camConfirm ConfirmActionMethod
Результат Task

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

deactivates the given mod.
public DeactivateMod ( IMod p_modMod, ReadOnlyObservableList p_rolActiveMods ) : IBackgroundTaskSet
p_modMod IMod The mod to deactivate.
p_rolActiveMods ReadOnlyObservableList The list of active mods.
Результат IBackgroundTaskSet

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

Runs the managed updaters.
public DeactivateMultipleMods ( ReadOnlyObservableList p_rolModList, ConfirmActionMethod p_camConfirm ) : IBackgroundTask
p_rolModList ReadOnlyObservableList The mod list.
p_camConfirm ConfirmActionMethod The delegate to call to confirm an action.
Результат IBackgroundTask

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

Deletes the given mod.
The mod is deactivated, unregistered, and then deleted.
public DeleteMod ( IMod p_modMod, ReadOnlyObservableList p_rolActiveMods ) : IBackgroundTaskSet
p_modMod IMod The mod to delete.
p_rolActiveMods ReadOnlyObservableList The list of active mods.
Результат IBackgroundTaskSet

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

Forces an upgrade from one mod to another.
No checks as to whether the two mods are actually related are performed. The new mod is reactivated as if it were the old mod, and the old mod is replaced by the new mod.
public ForceUpgrade ( IMod p_modOldMod, IMod p_modNewMod, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : IBackgroundTaskSet
p_modOldMod IMod The mod from which to upgrade.
p_modNewMod IMod The mod to which to upgrade.
p_dlgOverwriteConfirmationDelegate ConfirmItemOverwriteDelegate The method to call in order to confirm an overwrite.
Результат IBackgroundTaskSet

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

Gets the tagger to use to tag mods with metadata.
public GetModTagger ( ) : AutoTagger
Результат AutoTagger

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

Initializes the singleton intances of the mod manager.
Thrown if the mod manager has already /// been initialized.
public static Initialize ( IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, IModRepository p_mrpModRepository, DownloadMonitor p_dmrMonitor, ActivateModsMonitor p_ammMonitor, IModFormatRegistry p_frgFormatRegistry, ModRegistry p_mrgModRegistry, FileUtil p_futFileUtility, SynchronizationContext p_scxUIContext, IInstallLog p_ilgInstallLog, IPluginManager p_pmgPluginManager ) : ModManager
p_gmdGameMode IGameMode The current game mode.
p_eifEnvironmentInfo IEnvironmentInfo The application's envrionment info.
p_mrpModRepository IModRepository The mod repository from which to get mods and mod metadata.
p_dmrMonitor Nexus.Client.DownloadMonitoring.DownloadMonitor The download monitor to use to track task progress.
p_ammMonitor Nexus.Client.ActivateModsMonitoring.ActivateModsMonitor
p_frgFormatRegistry IModFormatRegistry The that contains the list /// of supported s.
p_mrgModRegistry ModRegistry The that contains the list /// of managed s.
p_futFileUtility Nexus.Client.Util.FileUtil The file utility class.
p_scxUIContext System.Threading.SynchronizationContext The to use to marshall UI interactions to the UI thread.
p_ilgInstallLog IInstallLog The install log tracking mod activations for the current game mode.
p_pmgPluginManager IPluginManager The plugin manager to use to work with plugins.
Результат ModManager

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

Loads the list of mods that are queued to be added to the mod manager.
public LoadQueuedMods ( ) : void
Результат void

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

Logins the user into the current mod repository.
public Login ( ) : bool
Результат bool

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

public Logout ( ) : void
Результат void

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

Reactivates the given mod.
A reactivation is an upgrade of a mod to itself. It re-runs the activation, without changing the installed precedence of its files and installed values.
public ReactivateMod ( IMod p_modMod, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : IBackgroundTaskSet
p_modMod IMod The mod to reactivate.
p_dlgOverwriteConfirmationDelegate ConfirmItemOverwriteDelegate The method to call in order to confirm an overwrite.
Результат IBackgroundTaskSet

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

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

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

Runs the managed updaters.
public SetupReadMeManager ( List p_lstModList, ConfirmActionMethod p_camConfirm ) : IBackgroundTask
p_lstModList List The mod list.
p_camConfirm ConfirmActionMethod The delegate to call to confirm an action.
Результат IBackgroundTask

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

Switches the mod category.
public SwitchModCategory ( IMod p_modMod, Int32 p_intCategoryId ) : void
p_modMod IMod The mod.
p_intCategoryId System.Int32 The new category id.
Результат void

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

Toggles the endorsement for the given mod.
public ToggleModEndorsement ( IMod p_modMod ) : void
p_modMod IMod The mod to endorse/unendorse.
Результат void

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

Runs the managed updaters.
public ToggleUpdateWarningTask ( HashSet p_hashMods, bool p_booEnable, ConfirmActionMethod p_camConfirm ) : IBackgroundTask
p_hashMods HashSet The hash of mods.
p_booEnable bool Enable/Disable/Toggle.
p_camConfirm ConfirmActionMethod The delegate to call to confirm an action.
Результат IBackgroundTask

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

Runs the managed updaters.
public UpdateMods ( List p_lstModList, ConfirmActionMethod p_camConfirm, bool p_booOverrideCategorySetup ) : IBackgroundTask
p_lstModList List The list of mods we need to update.
p_camConfirm ConfirmActionMethod The delegate to call to confirm an action.
p_booOverrideCategorySetup bool Whether to force a global update.
Результат IBackgroundTask

Описание свойств

IsBackupActive публичное свойство

public bool IsBackupActive
Результат bool

LoginTask публичное свойство

The loginform Task.
public LoginFormTask LoginTask
Результат LoginFormTask

lstMBInfo публичное свойство

public List lstMBInfo
Результат List