C# Class Nexus.Client.ModManagement.AddModTask

Adds, and downloads if required, a mod to the mod manager.
Inheritance: BackgroundTask, IDisposable
Afficher le fichier Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Méthodes publiques

Méthode Description
AddMod ( bool p_booQueued ) : void

Starts the mod adding task.

AddModTask ( IGameMode p_gmdGameMode, ReadMeManager p_rmmReadMeManager, IEnvironmentInfo p_eifEnvironmentInfo, ModRegistry p_mrgModRegistry, IModFormatRegistry p_frgFormatRegistry, IModRepository p_mrpModRepository, Uri p_uriPath, ConfirmOverwriteCallback p_cocConfirmOverwrite ) : System

A simple constructor that initializes the object with the given values.

Cancel ( ) : void

Cancels the task.

Dispose ( ) : void

Terminates all tasks started by this task.

After being disposed, that is no guarantee that the task's status will be correct. Further interaction with the object is undefined.

Pause ( ) : void

Pauses the task.

Queue ( ) : void

Queues the task.

Resume ( ) : void

Resumes the task.

Méthodes protégées

Méthode Description
AddModFile ( ConfirmOverwriteCallback p_cocConfirmOverwrite ) : void

Adds the mod file to the mod manager.

DownloadFiles ( List p_lstFiles, bool p_booQueued ) : void

Downloads the given files.

OnPropertyChanged ( PropertyChangedEventArgs e ) : void

Raises the INotifyPropertyChanged.PropertyChanged event.

This persists the task state to storage, so it can be resumed on client restart.

OnTaskEnded ( TaskEndedEventArgs e ) : void

Raises the IBackgroundTask.TaskEnded event.

This removes the task state from storage if it failed.

RegisterModFiles ( IList p_lstAddedMods ) : void

Registers the given mods with the registry.

Private Methods

Méthode Description
BuildDescriptor ( Uri p_uriPath ) : AddModDescriptor

Build the obejct that describes the mod being added.

Downloader_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Handles the INotifyPropertyChanged.PropertyChanged event of the file downloader tasks.

Downloader_TaskEnded ( object sender, TaskEndedEventArgs e ) : void

Handles the IBackgroundTask.TaskEnded event of the file downloader tasks.

GetModDisplayName ( ) : string

Gets the name of the mod to use for display.

GetModInfo ( AddModDescriptor p_amdDescriptor ) : IModInfo

Get the reposiroty info for the described mod.

ModBuilder_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Handles the INotifyPropertyChanged.PropertyChanged event of the mod builder task.

ModBuilder_TaskEnded ( object sender, TaskEndedEventArgs e ) : void

Handles the IBackgroundTask.TaskEnded event of the mod builder task.

Method Details

AddMod() public méthode

Starts the mod adding task.
public AddMod ( bool p_booQueued ) : void
p_booQueued bool
Résultat void

AddModFile() protected méthode

Adds the mod file to the mod manager.
protected AddModFile ( ConfirmOverwriteCallback p_cocConfirmOverwrite ) : void
p_cocConfirmOverwrite ConfirmOverwriteCallback The delegate to call to resolve conflicts with existing files.
Résultat void

AddModTask() public méthode

A simple constructor that initializes the object with the given values.
public AddModTask ( IGameMode p_gmdGameMode, ReadMeManager p_rmmReadMeManager, IEnvironmentInfo p_eifEnvironmentInfo, ModRegistry p_mrgModRegistry, IModFormatRegistry p_frgFormatRegistry, IModRepository p_mrpModRepository, Uri p_uriPath, ConfirmOverwriteCallback p_cocConfirmOverwrite ) : System
p_gmdGameMode IGameMode The game mode for which mods are being managed.
p_rmmReadMeManager ReadMeManager The ReadMe Manager info.
p_eifEnvironmentInfo IEnvironmentInfo The application's envrionment info.
p_mrgModRegistry ModRegistry The that contains the list of managed s.
p_frgFormatRegistry IModFormatRegistry The that contains the list /// of supported s.
p_mrpModRepository IModRepository The mod repository from which to get mods and mod metadata.
p_uriPath System.Uri The path to the mod to add.
p_cocConfirmOverwrite ConfirmOverwriteCallback The delegate to call to resolve conflicts with existing files.
Résultat System

Cancel() public méthode

Cancels the task.
public Cancel ( ) : void
Résultat void

Dispose() public méthode

Terminates all tasks started by this task.
After being disposed, that is no guarantee that the task's status will be correct. Further interaction with the object is undefined.
public Dispose ( ) : void
Résultat void

DownloadFiles() protected méthode

Downloads the given files.
protected DownloadFiles ( List p_lstFiles, bool p_booQueued ) : void
p_lstFiles List The files to download.
p_booQueued bool
Résultat void

OnPropertyChanged() protected méthode

Raises the INotifyPropertyChanged.PropertyChanged event.
This persists the task state to storage, so it can be resumed on client restart.
protected OnPropertyChanged ( PropertyChangedEventArgs e ) : void
e System.ComponentModel.PropertyChangedEventArgs A describing the event's arguments.
Résultat void

OnTaskEnded() protected méthode

Raises the IBackgroundTask.TaskEnded event.
This removes the task state from storage if it failed.
protected OnTaskEnded ( TaskEndedEventArgs e ) : void
e Nexus.Client.BackgroundTasks.TaskEndedEventArgs A describing the event's arguments.
Résultat void

Pause() public méthode

Pauses the task.
Thrown if the task does not support pausing.
public Pause ( ) : void
Résultat void

Queue() public méthode

Queues the task.
Thrown if the task does not support queuing.
public Queue ( ) : void
Résultat void

RegisterModFiles() protected méthode

Registers the given mods with the registry.
protected RegisterModFiles ( IList p_lstAddedMods ) : void
p_lstAddedMods IList The mods that have been added and need to be registered with the manager.
Résultat void

Resume() public méthode

Resumes the task.
Thrown if the task is not paused.
public Resume ( ) : void
Résultat void