C# Class Nexus.Client.ModManagement.UI.ModManagerControl

The view that exposes mod management functionality.
Inheritance: Nexus.Client.UI.ManagedFontDockContent
Mostrar archivo Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Public Properties

Property Type Description
clwCategoryView Nexus.Client.UI.Controls.CategoryListView
toolStrip1 System.Windows.Forms.ToolStrip

Private Properties

Property Type Description
ActiveMods_CollectionChanged void
CategoryListView_CategoryRemoved void
CategoryListView_CategorySwitch void
CategoryListView_CellEditFinishing void
CategoryListView_CellToolTipShowing void
CategoryListView_FileDropped void
CategoryListView_OpenReadMeFile void
CategoryListView_ReadmeScan void
CategoryListView_ToggleAllWarnings void
CategoryListView_ToggleUpdateWarning void
CheckModVersions void
ColumnSizer_Tick void
ConfirmItemOverwrite OverwriteResult
ConfirmModFileDeletion bool
ConfirmModFileOverwrite string
ConfirmModUpgrade ConfirmUpgradeResult
DoDispose void
GetSelectedMod IMod
GetSelectedMods List
GetSelectedModsHashset HashSet
HidePanels void
InitializeComponent void
LoadCategoryView void
ManagedMods_CollectionChanged void
ModManagerControl_Load void
Mod_PropertyChanged void
TaskSet_TaskSetCompleted void
TaskSet_TaskStarted void
ToggleEndorsement void
ViewModel_AddingMod void
ViewModel_ChangingModActivation void
ViewModel_DeactivatingMultipleMods void
ViewModel_DeletingMod void
ViewModel_ReadMeManagerSetup void
ViewModel_TaggingMod void
ViewModel_TogglingAllWarning void
ViewModel_UpdatingCategory void
ViewModel_UpdatingMods void
addModFromURLToolStripMenuItem_Click void
addModToolStripMenuItem_Click void
addNewCategory_Click void
clwCategoryView_AfterLabelEdit void
clwCategoryView_BeforeSorting void
clwCategoryView_ColumnClick void
clwCategoryView_ColumnWidthChanged void
clwCategoryView_ColumnWidthChanging void
clwCategoryView_Resize void
clwCategoryView_TreeBranchCollapsing void
clwCategoryView_TreeBranchExpanding void
collapseAllCategories_Click void
expandAllCategories_Click void
listView1_RetrieveVirtualItem void
removeAllCategories_Click void
resetDefaultCategories_Click void
resetModsCategory_Click void
resetUnassignedToDefaultCategories_Click void
toggleHiddenCategories_Click void
tsbAddMod_DropDownItemClicked void
tsbSwitchCategory_Click void

Public Methods

Method Description
DeactivateAllMods ( bool booForceUninstall ) : void

Handles the ToolStripItem.Click event of the deactivate all all the Active Mods button.

FindItemWithText ( string p_strFilter ) : void

Applies a string filter to the list view.

LoadListOnDemand ( string p_strProfilePath, string &p_strTempPath ) : bool

Load the list categories.

ModManagerControl ( ) : System

The default constructor.

RefreshModList ( ) : void

Reload the mod list control if needed

ResetColumns ( ) : void

Resets the CategoryView Columns to the original width

SetCommandBackupMMCStatus ( bool p_booCheck ) : void

Sets the executable status of the commands in the Mod Manager Control.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

LoadMetrics ( ) : void

Loads the control's saved metrics.

LoadModFormatFilter ( ) : void

Builds a filter string for open file dialog boxes that will display only supported mod files.

OnLoad ( EventArgs e ) : void

Raises the UserControl.Load event of the control.

This loads any saved control metrics.

SetCommandExecutableStatus ( ) : void

Sets the executable status of the commands.

SetModActivationCheck ( System.Windows.Forms.ListViewItem p_lviPlugin, bool p_booIsActive ) : void

Sets the checked state of the given list view item.

This sets the flag indicating we are changing the checked state of the list view item (as opposed to the user making the change), thus preventing the execution of commands as a result.

SizeColumnsToFit ( ) : void

This resizes the columns to fill the list view.

SizeColumnsToFitClw ( ) : void

This resizes the columns to fill the list view.

UpdateSummary ( IMod p_modMod ) : void

Updates the displayed summary information to reflect the given mod.

Private Methods

Method Description
ActiveMods_CollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void

Handles the INotifyCollectionChanged.CollectionChanged event of the view model's active mod list.

This updates the list of mods to refelct changes to which mods are active.

CategoryListView_CategoryRemoved ( object sender, EventArgs e ) : void

Handles the CategoryListView.CategoryRemoved of the switch mod category context menu.

CategoryListView_CategorySwitch ( object sender, EventArgs e ) : void

Handles the CategoryListView.CategorySwitch of the switch mod category context menu.

CategoryListView_CellEditFinishing ( object sender, BrightIdeasSoftware e ) : void

Handles the CategoryListView.CellEditFinishing.

CategoryListView_CellToolTipShowing ( object sender, BrightIdeasSoftware e ) : void

Handles the CategoryListView.CellToolTipShowing.

CategoryListView_FileDropped ( object sender, EventArgs e ) : void

Handles the CategoryListView.FileDropped of the switch mod category context menu.

CategoryListView_OpenReadMeFile ( object sender, EventArgs e ) : void

Handles the CategoryListView.OpenReadMeFile of the opening of the ReaMe file.

CategoryListView_ReadmeScan ( object sender, EventArgs e ) : void

Handles the CategoryListView.UpdateWarningToggle of the toggle mod update warning context menu.

CategoryListView_ToggleAllWarnings ( object sender, EventArgs e ) : void

Handles the CategoryListView.ToggleAllWarnings of the toggle mod update warning context menu.

CategoryListView_ToggleUpdateWarning ( object sender, EventArgs e ) : void

Handles the CategoryListView.UpdateWarningToggle of the toggle mod update warning context menu.

CheckModVersions ( ) : void
ColumnSizer_Tick ( object sender, EventArgs e ) : void

Handles the Timer.Tick event of the column sizer timer.

We use a timer to autosize the columns in the list view. This is because there is a bug in the control such that if we reszize the columns continuously while the list view is being resized, the item will sometimes disappear. To work around this, the list view resize event continually resets the timer. This means the timer will only fire occasionally during the resize, and avoid the disappearing items issue.

ConfirmItemOverwrite ( string p_strItemMessage, bool p_booAllowPerGroupChoice, bool p_booAllowPerModChoice ) : OverwriteResult

This asks the user to confirm the overwriting of the specified item.

ConfirmModFileDeletion ( IMod p_modMod ) : bool

This asks the use to confirm the deleting of the given mod file.

ConfirmModFileOverwrite ( string p_strFileName, string p_strNewFileName ) : string

This asks the use to confirm the overwriting of the specified mod file.

ConfirmModUpgrade ( IMod p_modOld, IMod p_modNew ) : ConfirmUpgradeResult

This asks the use to confirm the upgrading of the given old mod to the given new mod.

DoDispose ( ) : void

Allows extension of the dispose method.

GetSelectedMod ( ) : IMod

Retruns the mod that is currently selected in the view.

GetSelectedMods ( ) : List

Retruns the mod that is currently selected in the view.

GetSelectedModsHashset ( ) : HashSet

Parse the mod control list for selected mods.

HidePanels ( ) : void

Hides the description and image panels if they are empty.

InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

LoadCategoryView ( ) : void

Loads and initializes the CategoryListView control.

ManagedMods_CollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void

Handles the INotifyCollectionChanged.CollectionChanged event of the view model's installed mod list.

This updates the list of mods to refelct changes to the installed mod list.

ModManagerControl_Load ( object sender, EventArgs e ) : void

Handles the UserControl.Load event.

This wires up the ListView.ItemCheck event of the mod list. We need to wire it up after the control has loaded so that mod activation status isn't superfluously changed as items are first added to the list. A simple boolean flag won't work, as items can be added before the control is loaded, which delays the firing of the ListView.ItemCheck event until after the control is loaded, at which point the flag would have been reset.

Mod_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Handles the INotifyPropertyChanged.PropertyChanged event of the mods.

This updates list with the mod's updated information.

TaskSet_TaskSetCompleted ( object sender, TaskSetCompletedEventArgs e ) : void

Handles the IBackgroundTaskSet.TaskSetCompleted event of a task set.

This displays the confirmation message.

TaskSet_TaskStarted ( object sender, EventArgs e ) : void

Handles the IBackgroundTaskSet.TaskStarted event of a task set.

This displays the progress dialog.

ToggleEndorsement ( ) : void
ViewModel_AddingMod ( object sender, EventArgs e ) : void

Handles the ModManagerVM.AddingMod event of the view model.

This displays the progress dialog.

ViewModel_ChangingModActivation ( object sender, EventArgs e ) : void

Handles the ModManagerVM.ChangingModActivation event of the view model.

This watches the activations task set for starting task, so progress dialogs can be displayed.

ViewModel_DeactivatingMultipleMods ( object sender, EventArgs e ) : void

Handles the ModManagerVM.DeactivatingMultipleMods event of the view model.

This displays the progress dialog.

ViewModel_DeletingMod ( object sender, EventArgs e ) : void

Handles the ModManagerVM.DeletingMod event of the view model.

This watches the deletion task set for starting task, so progress dialogs can be displayed.

ViewModel_ReadMeManagerSetup ( object sender, EventArgs e ) : void

Handles the MainFormVM.ReadMeManagerSetup event of the view model.

This displays the progress dialog.

ViewModel_TaggingMod ( object sender, EventArgs e ) : void

Handles the ModManagerVM.TaggingMod event of the view model.

This displays the mod tagging view.

ViewModel_TogglingAllWarning ( object sender, EventArgs e ) : void

Handles the MainFormVM.ToggleModUpdateWarning event of the view model.

This displays the progress dialog.

ViewModel_UpdatingCategory ( object sender, EventArgs e ) : void

Handles the MainFormVM.Updating event of the view model.

This displays the progress dialog.

ViewModel_UpdatingMods ( object sender, EventArgs e ) : void

Handles the MainFormVM.Updating event of the view model.

This displays the progress dialog.

addModFromURLToolStripMenuItem_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the add mod from URL button.

This prompts the user for a URL, and then passes the URL as an argument to the ModManagerVM.AddModCommand command.

addModToolStripMenuItem_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the add mod button.

This prompts the user for a file, and then passes the filename as an argument to the ModManagerVM.AddModCommand command.

addNewCategory_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the add new category button.

clwCategoryView_AfterLabelEdit ( object sender, System.Windows.Forms.LabelEditEventArgs e ) : void

Handles the ListView.AfterLabelEdit event of the category view.

This updates the name of the mod/category.

clwCategoryView_BeforeSorting ( object sender, BrightIdeasSoftware e ) : void

Handles the CategoryListView.BeforeSorting event of the category view.

Saves the sort order.

clwCategoryView_ColumnClick ( object sender, System.Windows.Forms.ColumnClickEventArgs e ) : void

Handles the CategoryListView.ColumnClick event of the category view.

Saves the sort order.

clwCategoryView_ColumnWidthChanged ( object sender, System.Windows.Forms.ColumnWidthChangedEventArgs e ) : void

Handles the ListView.ColumnWidthChanged event of the mod list.

This saves the column width.

clwCategoryView_ColumnWidthChanging ( object sender, System.Windows.Forms.ColumnWidthChangingEventArgs e ) : void

Handles the ListView.ColumnWidthChanging event of the mod list.

This resizes the column next to the column being resized to resize as well, so that the columns keep the list view filled.

clwCategoryView_Resize ( object sender, EventArgs e ) : void

Handles the Control.Resize event of the plugin list.

This resizes the columns to fill the list view.

clwCategoryView_TreeBranchCollapsing ( object sender, BrightIdeasSoftware e ) : void

Handles the TreeView.Collapsing event of the category view.

clwCategoryView_TreeBranchExpanding ( object sender, BrightIdeasSoftware e ) : void

Handles the TreeView.Expanding event of the category view.

collapseAllCategories_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the add new category button.

expandAllCategories_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the add new category button.

listView1_RetrieveVirtualItem ( object sender, System.Windows.Forms.RetrieveVirtualItemEventArgs e ) : void

The Shift Key + mouse click event

removeAllCategories_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the remove all categories.

resetDefaultCategories_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the reset categories to repository default button.

resetModsCategory_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the reset mods to the Unassigned category.

resetUnassignedToDefaultCategories_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the reset unassigned mods to repository default button.

toggleHiddenCategories_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the add new category button.

tsbAddMod_DropDownItemClicked ( object sender, ToolStripItemClickedEventArgs e ) : void

Handles the ToolStripDropDownItem.DropDownItemClicked of the add mod split button.

This makes the last selected function the new default for the button.

tsbSwitchCategory_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the switch view button.

Method Details

DeactivateAllMods() public method

Handles the ToolStripItem.Click event of the deactivate all all the Active Mods button.
public DeactivateAllMods ( bool booForceUninstall ) : void
booForceUninstall bool
return void

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

FindItemWithText() public method

Applies a string filter to the list view.
public FindItemWithText ( string p_strFilter ) : void
p_strFilter string
return void

LoadListOnDemand() public method

Load the list categories.
public LoadListOnDemand ( string p_strProfilePath, string &p_strTempPath ) : bool
p_strProfilePath string The profile path.
p_strTempPath string The Temp path.
return bool

LoadMetrics() protected method

Loads the control's saved metrics.
protected LoadMetrics ( ) : void
return void

LoadModFormatFilter() protected method

Builds a filter string for open file dialog boxes that will display only supported mod files.
protected LoadModFormatFilter ( ) : void
return void

ModManagerControl() public method

The default constructor.
public ModManagerControl ( ) : System
return System

OnLoad() protected method

Raises the UserControl.Load event of the control.
This loads any saved control metrics.
protected OnLoad ( EventArgs e ) : void
e System.EventArgs An describing the event arguments.
return void

RefreshModList() public method

Reload the mod list control if needed
public RefreshModList ( ) : void
return void

ResetColumns() public method

Resets the CategoryView Columns to the original width
public ResetColumns ( ) : void
return void

SetCommandBackupMMCStatus() public method

Sets the executable status of the commands in the Mod Manager Control.
public SetCommandBackupMMCStatus ( bool p_booCheck ) : void
p_booCheck bool
return void

SetCommandExecutableStatus() protected method

Sets the executable status of the commands.
protected SetCommandExecutableStatus ( ) : void
return void

SetModActivationCheck() protected method

Sets the checked state of the given list view item.
This sets the flag indicating we are changing the checked state of the list view item (as opposed to the user making the change), thus preventing the execution of commands as a result.
protected SetModActivationCheck ( System.Windows.Forms.ListViewItem p_lviPlugin, bool p_booIsActive ) : void
p_lviPlugin System.Windows.Forms.ListViewItem The list view item whose checked state is to be changed.
p_booIsActive bool Whether the item should be active.
return void

SizeColumnsToFit() protected method

This resizes the columns to fill the list view.
protected SizeColumnsToFit ( ) : void
return void

SizeColumnsToFitClw() protected method

This resizes the columns to fill the list view.
protected SizeColumnsToFitClw ( ) : void
return void

UpdateSummary() protected method

Updates the displayed summary information to reflect the given mod.
protected UpdateSummary ( IMod p_modMod ) : void
p_modMod IMod The mod for which to display the summary information.
return void

Property Details

clwCategoryView public_oe property

public Nexus.Client.UI.Controls.CategoryListView clwCategoryView
return Nexus.Client.UI.Controls.CategoryListView

toolStrip1 public_oe property

public System.Windows.Forms.ToolStrip toolStrip1
return System.Windows.Forms.ToolStrip