C# Class Nexus.Client.MainForm

显示文件 Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Public Properties

Property Type Description
strOptionalPremiumMessage string
tsbTips System.Windows.Forms.ToolStripSplitButton
tstFind System.Windows.Forms.ToolStripTextBox

Private Properties

Property Type Description
ActiveTasks_CollectionChanged void
ActiveTasks_PropertyChanged void
ChangeGameModeCommand_Executed void
CheckDownloadsOnClosing void
ConfirmCloseAfterGameLaunch bool
ConfirmUpdaterAction bool
FindControlCoords Point
GameLauncher_GameLaunched void
GetSelectedVersion string
InitializeComponent void
LoginTask_PropertyChanged void
LogoutCommand_BeforeExecute void
MainForm_Resize void
MainForm_ResizeBegin void
MainForm_ResizeEnd void
ModRepository_UserStatusUpdate void
SetCommandBackupMFStatus void
ShowStartupMessage void
Tasks_CollectionChanged void
Tool_CloseToolView void
Tool_DisplayToolView void
UpdateProgressBarSpeed void
UpgradeBottomBarFeedbackCounter void
ViewModel_Updating void
amcActivateModsMonitor_EmptyQueue void
amcActivateModsMonitor_UpdateBottomBarFeedback void
bmBalloon_CloseClick void
bmBalloon_ShowNextClick void
bmBalloon_ShowPreviousClick void
close_Click void
dmcDownloadMonitor_SetTextBoxFocus void
dockPanel1_ActiveContentChanged void
mmgModManager_ResetSearchBox void
mmgModManager_SetTextBoxFocus void
mmgModManager_UpdateModsCount void
pmcPluginManager_UpdatePluginsCount void
spbChangeMode_ButtonClick void
spbFolders_ButtonClick void
spbHelp_ButtonClick void
spbLaunch_DropDownItemClicked void
spbTools_ButtonClick void
tmiHelp_Click void
tsbGoPremium_Click void
tsbSettings_Click void
tsbTips_DropDownItemClicked void
tstFind_KeyUp void

Public Methods

Method Description
MainForm ( MainFormVM p_vmlViewModel ) : System

A simple constructor that initializes the view with its dependencies.

RestoreFocus ( ) : void

Restores focus to the form.

ShowTips ( string p_strVersion ) : void

Shows the tips.

Protected Methods

Method Description
ApplyTheme ( Theme p_thmTheme ) : void

Applies the given theme to the form.

BindChangeModeCommands ( ) : void

Binds the change game mode commands to the UI.

BindCommands ( ) : void

Binds the commands to the UI.

BindFolderCommands ( ) : void

Binds the tool launch commands to the UI.

BindLaunchCommands ( ) : void

Binds the game launch commands to the UI.

BindToolCommands ( ) : void

Binds the tool launch commands to the UI.

Dispose ( bool disposing ) : void

Clean up any resources being used.

InitializeDocuments ( ) : void

Initializes the main UI components.

If the metrics of the various UI components have been saved, they are loaded. Otherwise, the default layout is applied.

LoadDockedContent ( string p_strContentId ) : IDockContent

Returns the UI component being requested when the form's metrics are being loaded.

LoadTips ( ) : void

The function that checks the Tips.

OnClosed ( EventArgs e ) : void

Raises the Form.Closed event of the form.

This saves the form's metrics.

OnClosing ( CancelEventArgs e ) : void

Raises the Form.Closing event.

This saves the current window position.

OnResize ( EventArgs e ) : void

Raises the Control.Resize event.

This saves the last window state before the form was minimized.

OnShown ( EventArgs e ) : void

Raises the Form.Shown event.

This notifies the view model the view is visible.

OpenGameFolder ( ) : void

Opens the selected game folder.

OpenInstallFolder ( ) : void

Opens NMM's install info folder for the current game.

OpenModsFolder ( ) : void

Opens NMM's mods folder for the current game.

ResetUI ( ) : void

Resets the UI layout to the default.

RestoreBackup ( ) : void

Load the backup file.

SortPlugins ( ) : void

Automatically sorts the plugin list.

UninstallAllMods ( ) : void

Uninstall all active mods.

UninstallAllMods ( bool booForceUninstall ) : void

Uninstall all active mods.

UserStatusFeedback ( ) : void

Sets the UI elements providing feedback on the user online status.

Private Methods

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

Handles the INotifyCollectionChanged.CollectionChanged event of the active tasks list.

Displays the activity monitor.

ActiveTasks_PropertyChanged ( object sender, System e ) : void

Handles the System.ComponentModel.ProgressChangedEventHandler event of the active tasks list.

Checks the current downloading speed.

ChangeGameModeCommand_Executed ( object sender, EventArgs e ) : void

Handles the Command.Executed event of the change game mode command.

This closes the application.

CheckDownloadsOnClosing ( object sender, FormClosingEventArgs e ) : void

Checks if there are any active downloads before closing the mod manager.

If there's an active download, the program will ask the user if he really wants to close it.

ConfirmCloseAfterGameLaunch ( bool &p_booRememberSelection ) : bool

Confirms if the manager should close after launching the game.

ConfirmUpdaterAction ( string p_strMessage, string p_strTitle ) : bool

This asks the user to confirm an updater action.

FindControlCoords ( string p_section, string p_object ) : Point
GameLauncher_GameLaunched ( object sender, GameLaunchEventArgs e ) : void

Handles the IGameLauncher.GameLaunched event of the game launcher.

This displays any message resulting from the game launch. If the launch was successful, the form is closed.

GetSelectedVersion ( ) : string
InitializeComponent ( ) : void

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

LoginTask_PropertyChanged ( object sender, EventArgs e ) : void
LogoutCommand_BeforeExecute ( object sender, CancelEventArgs e ) : void

Handles the Command.BeforeExecute event of the logout command.

This confirms whether the user wants to logout.

MainForm_Resize ( object sender, EventArgs e ) : void

The Main Form resize event.

MainForm_ResizeBegin ( object sender, EventArgs e ) : void

The Main Form resizeBegin event.

MainForm_ResizeEnd ( object sender, EventArgs e ) : void

The Main Form resizeEnd event.

ModRepository_UserStatusUpdate ( object sender, EventArgs e ) : void

Handles the ModRepository.UserStatusUpdate event of the tasks list.

Updates the UI elements.

SetCommandBackupMFStatus ( bool p_booCheck ) : void

During the backup enables/disables the Main Form icons.

ShowStartupMessage ( ) : void

Shows a startup message if needed.

Tasks_CollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void

Handles the INotifyCollectionChanged.CollectionChanged event of the tasks list.

Displays the activity monitor.

Tool_CloseToolView ( object sender, DisplayToolViewEventArgs e ) : void

Handles the ITool.CloseToolView event of a tool.

This closes the tool's view.

Tool_DisplayToolView ( object sender, DisplayToolViewEventArgs e ) : void

Handles the ITool.DisplayToolView event of a tool.

This shows the tool's view.

UpdateProgressBarSpeed ( string PropertyName, bool OverrideSpeed ) : void

Checks if the downloading speed progress bar needs to be updated.

UpgradeBottomBarFeedbackCounter ( ) : void

Updates the Bottom Bar Counter

ViewModel_Updating ( object sender, EventArgs e ) : void

Handles the MainFormVM.Updating event of the view model.

This displays the progress dialog.

amcActivateModsMonitor_EmptyQueue ( object sender, EventArgs e ) : void

Managing the LoadBackup status.

amcActivateModsMonitor_UpdateBottomBarFeedback ( object sender, EventArgs e ) : void

Updates the Bottom Bar Feedback

bmBalloon_CloseClick ( object sender, EventArgs e ) : void

The BalloonManager CloseClick event.

bmBalloon_ShowNextClick ( object sender, EventArgs e ) : void

The BalloonManager ShowNextClick event.

bmBalloon_ShowPreviousClick ( object sender, EventArgs e ) : void

The BalloonManager ShowPreviousClick event.

close_Click ( object sender, System e ) : void
dmcDownloadMonitor_SetTextBoxFocus ( object sender, EventArgs e ) : void

Set the focus to the Search Textbox.

dockPanel1_ActiveContentChanged ( object sender, EventArgs e ) : void

This will check whether the SearchBox should be visible.

mmgModManager_ResetSearchBox ( object sender, EventArgs e ) : void

The Main Form resetSearchBox event.

mmgModManager_SetTextBoxFocus ( object sender, EventArgs e ) : void

Set the focus to the Search Textbox.

mmgModManager_UpdateModsCount ( object sender, EventArgs e ) : void

Updates the Mods Counter

pmcPluginManager_UpdatePluginsCount ( object sender, EventArgs e ) : void

Updates the Plugins Counter

spbChangeMode_ButtonClick ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the change game mode button.

This displays the list of game modes when the button is clicked.

spbFolders_ButtonClick ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the tools button.

This displays the list of tools when the button is clicked.

spbHelp_ButtonClick ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the help button.

This displays the list of help items when the button is clicked.

spbLaunch_DropDownItemClicked ( object sender, ToolStripItemClickedEventArgs e ) : void

Handles the ToolStripDropDownItem.DropDownItemClicked of the launch game split button.

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

spbTools_ButtonClick ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the tools button.

This displays the list of tools when the button is clicked.

tmiHelp_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the help links.

This launches the link in the user's browser.

tsbGoPremium_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the Go Premium button.

Opens a default browser window on the Premium webpage.

tsbSettings_Click ( object sender, EventArgs e ) : void

Handles the ToolStripItem.Click event of the setting button.

Displays the settings form.

tsbTips_DropDownItemClicked ( object sender, ToolStripItemClickedEventArgs e ) : void
tstFind_KeyUp ( object sender, KeyEventArgs e ) : void

The Find KeyUp event.

Method Details

ApplyTheme() protected method

Applies the given theme to the form.
protected ApplyTheme ( Theme p_thmTheme ) : void
p_thmTheme Theme The theme to apply.
return void

BindChangeModeCommands() protected method

Binds the change game mode commands to the UI.
protected BindChangeModeCommands ( ) : void
return void

BindCommands() protected method

Binds the commands to the UI.
protected BindCommands ( ) : void
return void

BindFolderCommands() protected method

Binds the tool launch commands to the UI.
protected BindFolderCommands ( ) : void
return void

BindLaunchCommands() protected method

Binds the game launch commands to the UI.
protected BindLaunchCommands ( ) : void
return void

BindToolCommands() protected method

Binds the tool launch commands to the UI.
protected BindToolCommands ( ) : void
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

InitializeDocuments() protected method

Initializes the main UI components.
If the metrics of the various UI components have been saved, they are loaded. Otherwise, the default layout is applied.
protected InitializeDocuments ( ) : void
return void

LoadDockedContent() protected method

Returns the UI component being requested when the form's metrics are being loaded.
protected LoadDockedContent ( string p_strContentId ) : IDockContent
p_strContentId string The id of the component to return to be positioned.
return IDockContent

LoadTips() protected method

The function that checks the Tips.
protected LoadTips ( ) : void
return void

MainForm() public method

A simple constructor that initializes the view with its dependencies.
public MainForm ( MainFormVM p_vmlViewModel ) : System
p_vmlViewModel MainFormVM The view model that provides the data and operations for this view.
return System

OnClosed() protected method

Raises the Form.Closed event of the form.
This saves the form's metrics.
protected OnClosed ( EventArgs e ) : void
e EventArgs An describing the event arguments.
return void

OnClosing() protected method

Raises the Form.Closing event.
This saves the current window position.
protected OnClosing ( CancelEventArgs e ) : void
e CancelEventArgs A describing the event arguments.
return void

OnResize() protected method

Raises the Control.Resize event.
This saves the last window state before the form was minimized.
protected OnResize ( EventArgs e ) : void
e EventArgs An describing the event arguments.
return void

OnShown() protected method

Raises the Form.Shown event.
This notifies the view model the view is visible.
protected OnShown ( EventArgs e ) : void
e EventArgs An describing the event arguments.
return void

OpenGameFolder() protected method

Opens the selected game folder.
protected OpenGameFolder ( ) : void
return void

OpenInstallFolder() protected method

Opens NMM's install info folder for the current game.
protected OpenInstallFolder ( ) : void
return void

OpenModsFolder() protected method

Opens NMM's mods folder for the current game.
protected OpenModsFolder ( ) : void
return void

ResetUI() protected method

Resets the UI layout to the default.
protected ResetUI ( ) : void
return void

RestoreBackup() protected method

Load the backup file.
protected RestoreBackup ( ) : void
return void

RestoreFocus() public method

Restores focus to the form.
public RestoreFocus ( ) : void
return void

ShowTips() public method

Shows the tips.
public ShowTips ( string p_strVersion ) : void
p_strVersion string The version of the DropDownMenu clicked
return void

SortPlugins() protected method

Automatically sorts the plugin list.
protected SortPlugins ( ) : void
return void

UninstallAllMods() protected method

Uninstall all active mods.
protected UninstallAllMods ( ) : void
return void

UninstallAllMods() protected method

Uninstall all active mods.
protected UninstallAllMods ( bool booForceUninstall ) : void
booForceUninstall bool
return void

UserStatusFeedback() protected method

Sets the UI elements providing feedback on the user online status.
protected UserStatusFeedback ( ) : void
return void

Property Details

strOptionalPremiumMessage public_oe property

public string strOptionalPremiumMessage
return string

tsbTips public_oe property

public System.Windows.Forms.ToolStripSplitButton tsbTips
return System.Windows.Forms.ToolStripSplitButton

tstFind public_oe property

public System.Windows.Forms.ToolStripTextBox tstFind
return System.Windows.Forms.ToolStripTextBox