C# Class Nexus.Client.ModManagement.AddModTask

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

Public Methods

Method 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.

Protected Methods

Method 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

Method 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 method

Starts the mod adding task.
public AddMod ( bool p_booQueued ) : void
p_booQueued bool
return void

AddModFile() protected method

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.
return void

AddModTask() public method

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.
return System

Cancel() public method

Cancels the task.
public Cancel ( ) : void
return void

Dispose() public method

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
return void

DownloadFiles() protected method

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

OnPropertyChanged() protected method

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.
return void

OnTaskEnded() protected method

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.
return void

Pause() public method

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

Queue() public method

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

RegisterModFiles() protected method

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.
return void

Resume() public method

Resumes the task.
Thrown if the task is not paused.
public Resume ( ) : void
return void