C# Class Nexus.Client.PluginManagement.UI.PluginManagerVM

This class encapsulates the data and the operations presented by UI elements that display plugin management.
Afficher le fichier Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Méthodes publiques

Свойство Type Description
ConfirmUpdaterAction ConfirmActionMethod

Méthodes publiques

Méthode Description
ActivatePlugin ( Plugin p_plgPlugin ) : void

Activates the given plugin.

ApplyLoadOrder ( string>.Dictionary p_kvpRegisteredPlugins, bool p_booSortingOnly ) : void

Applies the load order specified by the given list of registered plugins

CanChangeActiveState ( Plugin p_plgPlugin ) : bool

Determines if the active state of the given plugin can be changed.

CanExecuteExportCommands ( ) : bool

Determines whether or not the load order can currently be exported for the current game mode.

CanExecuteImportCommands ( ) : bool

Determines whether or not a load order can currently be imported for the current game mode.

CanMovePluginUp ( Plugin p_plgPlugin ) : bool

Determines if the given plugin can be moved up in the load order.

CanMovePluginsDown ( IList p_lstPlugins ) : bool

Determines if the given plugins can be moved down in the load order.

DeactivatePlugin ( Plugin p_plgPlugin ) : void

deactivates the given plugin.

GetDefaultExportFilename ( ) : string

Returns a default filename for the current game mode when exporting the current load order.

GetExportFilterString ( ) : string

Returns the filter string used when exporting the current load order.

GetImportFilterString ( ) : string

Returns the filter string used when importing a load order.

GetRegisteredPlugins ( string>.Dictionary p_dctPluginFilenames, string>.Dictionary &p_kvpRegisteredPlugins, List &p_lstUnregisteredPlugins ) : void

Gets a list of registered plugins and unregistered plugin filenames for the specified game mode and list of plugin filenames.

GetRegisteredPlugins ( string p_lstPluginFilenames, string>.Dictionary &p_kvpOrderedPlugins ) : void

Gets a list of registered plugins and unregistered plugin filenames for the specified game mode and list of plugin filenames.

ImportLoadOrderFromFile ( string p_strFilename ) : void

Imports a load order from the specified file.

PluginManagerVM ( IPluginManager p_pmgPluginManager, ISettings p_setSettings, IGameMode p_gmdGameMode, ActivateModsMonitor p_ammMonitor ) : System

A simple constructor that initializes the object with its dependencies.

PluginsDisableAll ( ) : void

Deactivates all the enabled plugins.

PluginsEnableAll ( ) : void

Activates all the plugins.

RefreshPluginSorting ( string p_strPluginList ) : void

Automatically sorts the plugins.

SetPluginOrderIndex ( Plugin p_plgPlugin, int p_intNewIndex ) : void

Sets the load order of the specifid plugin.

SortPlugins ( ) : void

Automatically sorts the plugins.

ValidatePluginOrder ( IList p_lstPlugins ) : bool

Determines if the specified plugin order is valid.

Méthodes protégées

Méthode Description
ExportLoadOrderToClipboard ( ) : void

Exports the current load order to the clipboard.

ExportLoadOrderToFile ( string p_strFilename ) : void

Exports the current load order and game mode to a text file.

ImportLoadOrderFromClipboard ( ) : void

Imports a load order from the clipboard.

MovePluginsDown ( IList p_lstPlugins ) : void

Moves the given plugins down in the load order.

Moving plugins down in the load order increases the load order, meaning it is loaded later.

MovePluginsUp ( IEnumerable p_lstPlugins ) : void

Moves the given plugins up in the load order.

Moving plugins up in the load order decreases the load order, meaning it is loaded sooner.

OnExportFailed ( Exception p_exError ) : void

Raises the ExportFailed event.

OnExportFailed ( string p_strFilename, Exception p_exError ) : void

Raises the ExportFailed event.

OnExportSucceeded ( int p_intExportedPluginCount ) : void

Raises the ExportSucceeded event.

OnExportSucceeded ( string p_strFilename, int p_intExportedPluginCount ) : void

Raises the ExportSucceeded event.

OnImportFailed ( Exception p_exError ) : void

Raises the ImportFailed event.

OnImportFailed ( string p_strMessage ) : void

Raises the ImportFailed event.

OnImportFailed ( string p_strFilename, Exception p_exError ) : void

Raises the ImportFailed event.

OnImportFailed ( string p_strFilename, string p_strMessage ) : void

Raises the ImportFailed event.

OnImportPartiallySucceeded ( int p_intTotalPluginCount, int p_intImportedPluginCount, List p_lstPluginsNotImported ) : void

Raises the ImportPartiallySucceeded event.

OnImportPartiallySucceeded ( string p_strFilename, int p_intTotalPluginCount, int p_intImportedPluginCount, List p_lstPluginsNotImported ) : void

Raises the ImportPartiallySucceeded event.

OnImportSucceeded ( int p_intTotalPluginCount, int p_intImportedPluginCount, List p_lstPluginsNotImported ) : void

Raises the ImportSucceeded event.

OnImportSucceeded ( string p_strFilename, int p_intTotalPluginCount, int p_intImportedPluginCount, List p_lstPluginsNotImported ) : void

Raises the ImportSucceeded event.

Private Methods

Méthode Description
ExportLoadOrder ( TextWriter p_twWriter ) : int

Writes the current load order and the id of the specified game mode to the specified TextWriter and returns the number of plugins written.

ImportLoadOrder ( TextReader p_trReader, int &p_intTotalPluginCount, int &p_intImportedCount, List &p_lstUnregisteredPlugins ) : void

Read the load order from the specified TextReader and returns the number of plugins imported as well as the number of plugins not found.

LoadOrderManager_ActivePluginUpdate ( object sender, EventArgs e ) : void

Handles changes to the plugin activation state made by external programs (or manually)

LoadOrderManager_ExternalPluginAdded ( object sender, EventArgs e ) : void

Handles new plugins added by external programs (or manually)

LoadOrderManager_ExternalPluginRemoved ( object sender, EventArgs e ) : void

Handles plugins removed by external programs (or manually)

LoadOrderManager_LoadOrderUpdate ( object sender, EventArgs e ) : void

Handles changes to the plugin load order made by external programs (or manually)

ReadImportSource ( TextReader p_trReader ) : string>.Dictionary

Reads the list of plugin filenames from the specified import source, making sure it is for the current game mode.

Method Details

ActivatePlugin() public méthode

Activates the given plugin.
public ActivatePlugin ( Plugin p_plgPlugin ) : void
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin to activate.
Résultat void

ApplyLoadOrder() public méthode

Applies the load order specified by the given list of registered plugins
public ApplyLoadOrder ( string>.Dictionary p_kvpRegisteredPlugins, bool p_booSortingOnly ) : void
p_kvpRegisteredPlugins string>.Dictionary
p_booSortingOnly bool Whether we just want to apply the sorting.
Résultat void

CanChangeActiveState() public méthode

Determines if the active state of the given plugin can be changed.
public CanChangeActiveState ( Plugin p_plgPlugin ) : bool
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin for which it is to be determined if the active state can be changed.
Résultat bool

CanExecuteExportCommands() public méthode

Determines whether or not the load order can currently be exported for the current game mode.
public CanExecuteExportCommands ( ) : bool
Résultat bool

CanExecuteImportCommands() public méthode

Determines whether or not a load order can currently be imported for the current game mode.
public CanExecuteImportCommands ( ) : bool
Résultat bool

CanMovePluginUp() public méthode

Determines if the given plugin can be moved up in the load order.
public CanMovePluginUp ( Plugin p_plgPlugin ) : bool
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin for which it is to be determined if the load order can be decreased.
Résultat bool

CanMovePluginsDown() public méthode

Determines if the given plugins can be moved down in the load order.
public CanMovePluginsDown ( IList p_lstPlugins ) : bool
p_lstPlugins IList The plugins for which it is to be determined if the load order can be increased.
Résultat bool

DeactivatePlugin() public méthode

deactivates the given plugin.
public DeactivatePlugin ( Plugin p_plgPlugin ) : void
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin to deactivate.
Résultat void

ExportLoadOrderToClipboard() protected méthode

Exports the current load order to the clipboard.
protected ExportLoadOrderToClipboard ( ) : void
Résultat void

ExportLoadOrderToFile() protected méthode

Exports the current load order and game mode to a text file.
protected ExportLoadOrderToFile ( string p_strFilename ) : void
p_strFilename string The filename to export the load order to.
Résultat void

GetDefaultExportFilename() public méthode

Returns a default filename for the current game mode when exporting the current load order.
public GetDefaultExportFilename ( ) : string
Résultat string

GetExportFilterString() public méthode

Returns the filter string used when exporting the current load order.
public GetExportFilterString ( ) : string
Résultat string

GetImportFilterString() public méthode

Returns the filter string used when importing a load order.
public GetImportFilterString ( ) : string
Résultat string

GetRegisteredPlugins() public méthode

Gets a list of registered plugins and unregistered plugin filenames for the specified game mode and list of plugin filenames.
The value of PluginDirectory for the current game mode is empty.
public GetRegisteredPlugins ( string>.Dictionary p_dctPluginFilenames, string>.Dictionary &p_kvpRegisteredPlugins, List &p_lstUnregisteredPlugins ) : void
p_dctPluginFilenames string>.Dictionary
p_kvpRegisteredPlugins string>.Dictionary
p_lstUnregisteredPlugins List The return list of unregistered plugin filenames.
Résultat void

GetRegisteredPlugins() public méthode

Gets a list of registered plugins and unregistered plugin filenames for the specified game mode and list of plugin filenames.
The value of PluginDirectory for the current game mode is empty.
public GetRegisteredPlugins ( string p_lstPluginFilenames, string>.Dictionary &p_kvpOrderedPlugins ) : void
p_lstPluginFilenames string The dictionary of plugin filenames.
p_kvpOrderedPlugins string>.Dictionary The return list of registered plugins.
Résultat void

ImportLoadOrderFromClipboard() protected méthode

Imports a load order from the clipboard.
protected ImportLoadOrderFromClipboard ( ) : void
Résultat void

ImportLoadOrderFromFile() public méthode

Imports a load order from the specified file.
public ImportLoadOrderFromFile ( string p_strFilename ) : void
p_strFilename string The filename to import a load order from.
Résultat void

MovePluginsDown() protected méthode

Moves the given plugins down in the load order.
Moving plugins down in the load order increases the load order, meaning it is loaded later.
protected MovePluginsDown ( IList p_lstPlugins ) : void
p_lstPlugins IList The plugins whose load order is to be changed.
Résultat void

MovePluginsUp() protected méthode

Moves the given plugins up in the load order.
Moving plugins up in the load order decreases the load order, meaning it is loaded sooner.
protected MovePluginsUp ( IEnumerable p_lstPlugins ) : void
p_lstPlugins IEnumerable The plugins whose load order is to be changed.
Résultat void

OnExportFailed() protected méthode

Raises the ExportFailed event.
protected OnExportFailed ( Exception p_exError ) : void
p_exError System.Exception The error that occurred.
Résultat void

OnExportFailed() protected méthode

Raises the ExportFailed event.
protected OnExportFailed ( string p_strFilename, Exception p_exError ) : void
p_strFilename string The filename that the load order failed to export to.
p_exError System.Exception The error that occurred.
Résultat void

OnExportSucceeded() protected méthode

Raises the ExportSucceeded event.
protected OnExportSucceeded ( int p_intExportedPluginCount ) : void
p_intExportedPluginCount int The number of plaugins that were exported.
Résultat void

OnExportSucceeded() protected méthode

Raises the ExportSucceeded event.
protected OnExportSucceeded ( string p_strFilename, int p_intExportedPluginCount ) : void
p_strFilename string The filename that the load order was exported to.
p_intExportedPluginCount int The number of plaugins that were exported.
Résultat void

OnImportFailed() protected méthode

Raises the ImportFailed event.
protected OnImportFailed ( Exception p_exError ) : void
p_exError System.Exception The error that occurred.
Résultat void

OnImportFailed() protected méthode

Raises the ImportFailed event.
protected OnImportFailed ( string p_strMessage ) : void
p_strMessage string A message describing why the import failed.
Résultat void

OnImportFailed() protected méthode

Raises the ImportFailed event.
protected OnImportFailed ( string p_strFilename, Exception p_exError ) : void
p_strFilename string The filename that the load order failed to import from.
p_exError System.Exception The error that occurred.
Résultat void

OnImportFailed() protected méthode

Raises the ImportFailed event.
protected OnImportFailed ( string p_strFilename, string p_strMessage ) : void
p_strFilename string The filename that the load order failed to import from.
p_strMessage string A message describing why the import failed.
Résultat void

OnImportPartiallySucceeded() protected méthode

Raises the ImportPartiallySucceeded event.
protected OnImportPartiallySucceeded ( int p_intTotalPluginCount, int p_intImportedPluginCount, List p_lstPluginsNotImported ) : void
p_intTotalPluginCount int The total number of plugins that were found in the specified import source.
p_intImportedPluginCount int The number of plugins that were imported.
p_lstPluginsNotImported List The list of plugins that were not found in the collection.
Résultat void

OnImportPartiallySucceeded() protected méthode

Raises the ImportPartiallySucceeded event.
protected OnImportPartiallySucceeded ( string p_strFilename, int p_intTotalPluginCount, int p_intImportedPluginCount, List p_lstPluginsNotImported ) : void
p_strFilename string The filename that the load order was imported from.
p_intTotalPluginCount int The total number of plugins that were found in the specified import source.
p_intImportedPluginCount int The number of plugins that were imported.
p_lstPluginsNotImported List The list of plugins that were not found in the collection.
Résultat void

OnImportSucceeded() protected méthode

Raises the ImportSucceeded event.
protected OnImportSucceeded ( int p_intTotalPluginCount, int p_intImportedPluginCount, List p_lstPluginsNotImported ) : void
p_intTotalPluginCount int The total number of plugins that were found in the specified import source.
p_intImportedPluginCount int The number of plugins that were imported.
p_lstPluginsNotImported List The list of plugins that were not found in the collection.
Résultat void

OnImportSucceeded() protected méthode

Raises the ImportSucceeded event.
protected OnImportSucceeded ( string p_strFilename, int p_intTotalPluginCount, int p_intImportedPluginCount, List p_lstPluginsNotImported ) : void
p_strFilename string The filename that the load order was imported from.
p_intTotalPluginCount int The total number of plugins that were found in the specified import source.
p_intImportedPluginCount int The number of plugins that were imported.
p_lstPluginsNotImported List The list of plugins that were not found in the collection.
Résultat void

PluginManagerVM() public méthode

A simple constructor that initializes the object with its dependencies.
public PluginManagerVM ( IPluginManager p_pmgPluginManager, ISettings p_setSettings, IGameMode p_gmdGameMode, ActivateModsMonitor p_ammMonitor ) : System
p_pmgPluginManager IPluginManager The plugin manager to use to manage plugins.
p_setSettings ISettings The application and user settings.
p_gmdGameMode IGameMode The game mode that is currently being managed.
p_ammMonitor Nexus.Client.ActivateModsMonitoring.ActivateModsMonitor
Résultat System

PluginsDisableAll() public méthode

Deactivates all the enabled plugins.
public PluginsDisableAll ( ) : void
Résultat void

PluginsEnableAll() public méthode

Activates all the plugins.
public PluginsEnableAll ( ) : void
Résultat void

RefreshPluginSorting() public méthode

Automatically sorts the plugins.
public RefreshPluginSorting ( string p_strPluginList ) : void
p_strPluginList string
Résultat void

SetPluginOrderIndex() public méthode

Sets the load order of the specifid plugin.
public SetPluginOrderIndex ( Plugin p_plgPlugin, int p_intNewIndex ) : void
p_plgPlugin Nexus.Client.Plugins.Plugin The full path to the plugin file whose load order is to be set.
p_intNewIndex int The new load order index of the plugin.
Résultat void

SortPlugins() public méthode

Automatically sorts the plugins.
public SortPlugins ( ) : void
Résultat void

ValidatePluginOrder() public méthode

Determines if the specified plugin order is valid.
public ValidatePluginOrder ( IList p_lstPlugins ) : bool
p_lstPlugins IList The plugins whose order is to be validated.
Résultat bool

Property Details

ConfirmUpdaterAction public_oe property

Called when an updater's action needs to be confirmed.
public ConfirmActionMethod ConfirmUpdaterAction
Résultat ConfirmActionMethod