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

This class encapsulates the data and the operations presented by UI elements that display plugin management.
显示文件 Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Public Properties

Property Type Description
ConfirmUpdaterAction ConfirmActionMethod

Public Methods

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

Protected Methods

Method 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

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

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

ApplyLoadOrder() public method

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

CanChangeActiveState() public method

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

CanExecuteExportCommands() public method

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

CanExecuteImportCommands() public method

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

CanMovePluginUp() public method

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

CanMovePluginsDown() public method

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

DeactivatePlugin() public method

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

ExportLoadOrderToClipboard() protected method

Exports the current load order to the clipboard.
protected ExportLoadOrderToClipboard ( ) : void
return void

ExportLoadOrderToFile() protected method

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

GetDefaultExportFilename() public method

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

GetExportFilterString() public method

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

GetImportFilterString() public method

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

GetRegisteredPlugins() public method

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

GetRegisteredPlugins() public method

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

ImportLoadOrderFromClipboard() protected method

Imports a load order from the clipboard.
protected ImportLoadOrderFromClipboard ( ) : void
return void

ImportLoadOrderFromFile() public method

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

MovePluginsDown() protected method

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

MovePluginsUp() protected method

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

OnExportFailed() protected method

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

OnExportFailed() protected method

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

OnExportSucceeded() protected method

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

OnExportSucceeded() protected method

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

OnImportFailed() protected method

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

OnImportFailed() protected method

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

OnImportFailed() protected method

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

OnImportFailed() protected method

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

OnImportPartiallySucceeded() protected method

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

OnImportPartiallySucceeded() protected method

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

OnImportSucceeded() protected method

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

OnImportSucceeded() protected method

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

PluginManagerVM() public method

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

PluginsDisableAll() public method

Deactivates all the enabled plugins.
public PluginsDisableAll ( ) : void
return void

PluginsEnableAll() public method

Activates all the plugins.
public PluginsEnableAll ( ) : void
return void

RefreshPluginSorting() public method

Automatically sorts the plugins.
public RefreshPluginSorting ( string p_strPluginList ) : void
p_strPluginList string
return void

SetPluginOrderIndex() public method

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

SortPlugins() public method

Automatically sorts the plugins.
public SortPlugins ( ) : void
return void

ValidatePluginOrder() public method

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

Property Details

ConfirmUpdaterAction public_oe property

Called when an updater's action needs to be confirmed.
public ConfirmActionMethod ConfirmUpdaterAction
return ConfirmActionMethod