C# Класс Nexus.Client.PluginManagement.UI.PluginManagerVM

This class encapsulates the data and the operations presented by UI elements that display plugin management.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ConfirmUpdaterAction ConfirmActionMethod

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

ActivatePlugin() публичный Метод

Activates the given plugin.
public ActivatePlugin ( Plugin p_plgPlugin ) : void
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin to activate.
Результат void

ApplyLoadOrder() публичный Метод

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.
Результат void

CanChangeActiveState() публичный Метод

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.
Результат bool

CanExecuteExportCommands() публичный Метод

Determines whether or not the load order can currently be exported for the current game mode.
public CanExecuteExportCommands ( ) : bool
Результат bool

CanExecuteImportCommands() публичный Метод

Determines whether or not a load order can currently be imported for the current game mode.
public CanExecuteImportCommands ( ) : bool
Результат bool

CanMovePluginUp() публичный Метод

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.
Результат bool

CanMovePluginsDown() публичный Метод

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.
Результат bool

DeactivatePlugin() публичный Метод

deactivates the given plugin.
public DeactivatePlugin ( Plugin p_plgPlugin ) : void
p_plgPlugin Nexus.Client.Plugins.Plugin The plugin to deactivate.
Результат void

ExportLoadOrderToClipboard() защищенный Метод

Exports the current load order to the clipboard.
protected ExportLoadOrderToClipboard ( ) : void
Результат void

ExportLoadOrderToFile() защищенный Метод

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.
Результат void

GetDefaultExportFilename() публичный Метод

Returns a default filename for the current game mode when exporting the current load order.
public GetDefaultExportFilename ( ) : string
Результат string

GetExportFilterString() публичный Метод

Returns the filter string used when exporting the current load order.
public GetExportFilterString ( ) : string
Результат string

GetImportFilterString() публичный Метод

Returns the filter string used when importing a load order.
public GetImportFilterString ( ) : string
Результат string

GetRegisteredPlugins() публичный Метод

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.
Результат void

GetRegisteredPlugins() публичный Метод

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.
Результат void

ImportLoadOrderFromClipboard() защищенный Метод

Imports a load order from the clipboard.
protected ImportLoadOrderFromClipboard ( ) : void
Результат void

ImportLoadOrderFromFile() публичный Метод

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.
Результат void

MovePluginsDown() защищенный Метод

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.
Результат void

MovePluginsUp() защищенный Метод

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.
Результат void

OnExportFailed() защищенный Метод

Raises the ExportFailed event.
protected OnExportFailed ( Exception p_exError ) : void
p_exError System.Exception The error that occurred.
Результат void

OnExportFailed() защищенный Метод

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.
Результат void

OnExportSucceeded() защищенный Метод

Raises the ExportSucceeded event.
protected OnExportSucceeded ( int p_intExportedPluginCount ) : void
p_intExportedPluginCount int The number of plaugins that were exported.
Результат void

OnExportSucceeded() защищенный Метод

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.
Результат void

OnImportFailed() защищенный Метод

Raises the ImportFailed event.
protected OnImportFailed ( Exception p_exError ) : void
p_exError System.Exception The error that occurred.
Результат void

OnImportFailed() защищенный Метод

Raises the ImportFailed event.
protected OnImportFailed ( string p_strMessage ) : void
p_strMessage string A message describing why the import failed.
Результат void

OnImportFailed() защищенный Метод

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.
Результат void

OnImportFailed() защищенный Метод

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.
Результат void

OnImportPartiallySucceeded() защищенный Метод

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.
Результат void

OnImportPartiallySucceeded() защищенный Метод

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.
Результат void

OnImportSucceeded() защищенный Метод

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.
Результат void

OnImportSucceeded() защищенный Метод

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.
Результат void

PluginManagerVM() публичный Метод

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
Результат System

PluginsDisableAll() публичный Метод

Deactivates all the enabled plugins.
public PluginsDisableAll ( ) : void
Результат void

PluginsEnableAll() публичный Метод

Activates all the plugins.
public PluginsEnableAll ( ) : void
Результат void

RefreshPluginSorting() публичный Метод

Automatically sorts the plugins.
public RefreshPluginSorting ( string p_strPluginList ) : void
p_strPluginList string
Результат void

SetPluginOrderIndex() публичный Метод

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.
Результат void

SortPlugins() публичный Метод

Automatically sorts the plugins.
public SortPlugins ( ) : void
Результат void

ValidatePluginOrder() публичный Метод

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.
Результат bool

Описание свойств

ConfirmUpdaterAction публичное свойство

Called when an updater's action needs to be confirmed.
public ConfirmActionMethod ConfirmUpdaterAction
Результат ConfirmActionMethod