C# Class 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.
Afficher le fichier Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Méthodes publiques

Свойство Type Description
IsBackupActive bool
LoginTask LoginFormTask
lstMBInfo List

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

ActivateMod() public méthode

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.
Résultat IBackgroundTaskSet

AddMod() public méthode

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.
Résultat IBackgroundTask

AsyncAddMod() public méthode

public AsyncAddMod ( Uri p_uriPath, ConfirmOverwriteCallback p_cocConfirmOverwrite ) : IBackgroundTask
p_uriPath System.Uri
p_cocConfirmOverwrite ConfirmOverwriteCallback
Résultat IBackgroundTask

AsyncAddModTask() public méthode

public AsyncAddModTask ( IBackgroundTask p_tskAddModTask ) : void
p_tskAddModTask IBackgroundTask
Résultat void

AsyncEndorseMod() public méthode

Async toggle of the endorsement for the given mod.
public AsyncEndorseMod ( IMod p_modMod ) : void
p_modMod IMod The mod to endorse/unendorse.
Résultat void

AsyncTagMod() public méthode

public AsyncTagMod ( ModManagement p_ModManagerVM, ModManagement p_ModTaggerVM, EventHandler p_TaggingMod ) : void
p_ModManagerVM ModManagement
p_ModTaggerVM ModManagement
p_TaggingMod EventHandler
Résultat void

AsyncUpdateMods() public méthode

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.
Résultat void

AsyncUpdateModsTask() public méthode

public AsyncUpdateModsTask ( ModUpdateCheckTask p_mutModUpdateCheck, ConfirmActionMethod p_camConfirm ) : Task
p_mutModUpdateCheck ModUpdateCheckTask
p_camConfirm ConfirmActionMethod
Résultat Task

DeactivateMod() public méthode

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.
Résultat IBackgroundTaskSet

DeactivateMultipleMods() public méthode

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.
Résultat IBackgroundTask

DeleteMod() public méthode

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.
Résultat IBackgroundTaskSet

ForceUpgrade() public méthode

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.
Résultat IBackgroundTaskSet

GetModTagger() public méthode

Gets the tagger to use to tag mods with metadata.
public GetModTagger ( ) : AutoTagger
Résultat AutoTagger

Initialize() public static méthode

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.
Résultat ModManager

LoadQueuedMods() public méthode

Loads the list of mods that are queued to be added to the mod manager.
public LoadQueuedMods ( ) : void
Résultat void

Login() public méthode

Logins the user into the current mod repository.
public Login ( ) : bool
Résultat bool

Logout() public méthode

public Logout ( ) : void
Résultat void

ReactivateMod() public méthode

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.
Résultat IBackgroundTaskSet

Release() public méthode

This disposes of the singleton object, allowing it to be re-initialized.
public Release ( ) : void
Résultat void

SetupReadMeManager() public méthode

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.
Résultat IBackgroundTask

SwitchModCategory() public méthode

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.
Résultat void

ToggleModEndorsement() public méthode

Toggles the endorsement for the given mod.
public ToggleModEndorsement ( IMod p_modMod ) : void
p_modMod IMod The mod to endorse/unendorse.
Résultat void

ToggleUpdateWarningTask() public méthode

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.
Résultat IBackgroundTask

UpdateMods() public méthode

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.
Résultat IBackgroundTask

Property Details

IsBackupActive public_oe property

public bool IsBackupActive
Résultat bool

LoginTask public_oe property

The loginform Task.
public LoginFormTask LoginTask
Résultat LoginFormTask

lstMBInfo public_oe property

public List lstMBInfo
Résultat List