C# Class Nexus.Client.ModManagement.CategoryManager

Inheritance: ICategoryManager
Exibir arquivo Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Public Methods

Method Description
AddCategory ( ) : IModCategory

Adds a new category to the list with default values.

AddCategory ( IModCategory p_mctCategory ) : IModCategory

Adds a category to the list.

Backup ( ) : void

This backs up the category file.

CategoryManager ( string p_strModInstallDirectory, string p_strCategoryPath ) : System

A simple constructor that initializes the object with its dependencies.

FindCategory ( Int32 p_intCategoryId ) : IModCategory

Finds the category by Id.

LoadCategories ( string p_strDefaultCategories ) : void

Loads the categories.

ReadVersion ( string p_strCategoryPath ) : System.Version

Reads the category manager version from the given category file.

Release ( ) : void

This disposes of the category manager, allowing it to be re-initialized.

RemoveCategory ( IModCategory p_mctCategory ) : void

Removes a category from the list.

ResetCategories ( Uri p_uriDefaultCategories ) : void

Loads the categories from an online source.

ResetCategories ( string p_strDefaultCategories ) : void

Resets to the repository default categories.

Restore ( string p_strCategoryPath ) : bool

This restores the first valid backup of the category file.

Update ( ModManager p_ModManager, IList p_lstMods, Int32 p_intNewValue, ConfirmActionMethod p_camConfirm ) : IBackgroundTask

Runs the managed updaters.

UpdateCategoryFile ( ) : void

Updates the category file.

Protected Methods

Method Description
IsValid ( string p_strCategoryPath ) : bool

Determines if the category file at the given path is valid.

SaveCategories ( ) : void

Save the data to the category file.

Private Methods

Method Description
LoadCategories ( System.Xml.Linq.XDocument p_docCategories ) : void

Loads the data from the category file.

Method Details

AddCategory() public method

Adds a new category to the list with default values.
public AddCategory ( ) : IModCategory
return IModCategory

AddCategory() public method

Adds a category to the list.
public AddCategory ( IModCategory p_mctCategory ) : IModCategory
p_mctCategory IModCategory The being added.
return IModCategory

Backup() public method

This backs up the category file.
public Backup ( ) : void
return void

CategoryManager() public method

A simple constructor that initializes the object with its dependencies.
public CategoryManager ( string p_strModInstallDirectory, string p_strCategoryPath ) : System
p_strModInstallDirectory string The path of the directory where all of the mods are installed.
p_strCategoryPath string The path from which to load the categories.
return System

FindCategory() public method

Finds the category by Id.
public FindCategory ( Int32 p_intCategoryId ) : IModCategory
p_intCategoryId System.Int32 The category Id.
return IModCategory

IsValid() protected static method

Determines if the category file at the given path is valid.
protected static IsValid ( string p_strCategoryPath ) : bool
p_strCategoryPath string The path of the category file to validate.
return bool

LoadCategories() public method

Loads the categories.
public LoadCategories ( string p_strDefaultCategories ) : void
p_strDefaultCategories string The string containing the default categories.
return void

ReadVersion() public static method

Reads the category manager version from the given category file.
public static ReadVersion ( string p_strCategoryPath ) : System.Version
p_strCategoryPath string The category file whose version is to be read.
return System.Version

Release() public method

This disposes of the category manager, allowing it to be re-initialized.
public Release ( ) : void
return void

RemoveCategory() public method

Removes a category from the list.
public RemoveCategory ( IModCategory p_mctCategory ) : void
p_mctCategory IModCategory The to be removed.
return void

ResetCategories() public method

Loads the categories from an online source.
public ResetCategories ( Uri p_uriDefaultCategories ) : void
p_uriDefaultCategories System.Uri The online path where the category file is stored.
return void

ResetCategories() public method

Resets to the repository default categories.
public ResetCategories ( string p_strDefaultCategories ) : void
p_strDefaultCategories string The string containing the new category list.
return void

Restore() public static method

This restores the first valid backup of the category file.
public static Restore ( string p_strCategoryPath ) : bool
p_strCategoryPath string The path to the category folder.
return bool

SaveCategories() protected method

Save the data to the category file.
protected SaveCategories ( ) : void
return void

Update() public method

Runs the managed updaters.
public Update ( ModManager p_ModManager, IList p_lstMods, Int32 p_intNewValue, ConfirmActionMethod p_camConfirm ) : IBackgroundTask
p_ModManager ModManager The Mod Manager.
p_lstMods IList The list of mods to update.
p_intNewValue System.Int32 The new category id value.
p_camConfirm ConfirmActionMethod The delegate to call to confirm an action.
return IBackgroundTask

UpdateCategoryFile() public method

Updates the category file.
public UpdateCategoryFile ( ) : void
return void