C# Class Nexus.Client.DownloadMonitoring.UI.DownloadMonitorControl

Show file Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Private Properties

Property Type Description
ActiveTasks_CollectionChanged void
ActiveTasks_PropertyChanged void
ColumnSizer_Tick void
DownloadMonitorControl_FormClosing void
DownloadMonitorControl_KeyUp void
DownloadMonitorControl_MouseClick void
GetSelectedTask AddModTask
InitializeComponent void
Task_PropertyChanged void
Tasks_CollectionChanged void
cmsContextMenu_Copy void
lvwTasks_ColumnWidthChanging void
lvwTasks_Resize void
lvwTasks_SelectedIndexChanged void

Public Methods

Method Description
DownloadMonitorControl ( ) : System

The default constructor.

Protected Methods

Method Description
AddTaskToList ( AddModTask p_tskTask ) : void

Adds the given IBackgroundTask to the view's list. If the IBackgroundTask already exists in the list, nothing is done.

Dispose ( bool disposing ) : void

Clean up any resources being used.

LoadMetrics ( ) : void

Loads the control's saved metrics.

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.

SizeColumnsToFit ( ) : void

This resizes the columns to fill the list view.

UpdateTitle ( ) : void

Updates the control's title to reflect the current state of activities.

Private Methods

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

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

This updates the control title.

ActiveTasks_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Handles the INotifyPropertyChanged.PropertyChanged of the active tasks being monitored.

This adjusts the command availability based on the active task's status.

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.

DownloadMonitorControl_FormClosing ( object sender, FormClosingEventArgs e ) : void

Handles the Form.Closing event of the parent form.

This saves the control's metrics.

DownloadMonitorControl_KeyUp ( object sender, KeyEventArgs e ) : void

Hanldes the Control.KeyUp event of the controls.

DownloadMonitorControl_MouseClick ( object sender, MouseEventArgs e ) : void

Hanldes the Control.MouseClick event of the controls.

GetSelectedTask ( ) : AddModTask

Retruns the IBackgroundTask that is currently selected in the view.

InitializeComponent ( ) : void

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

Task_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Handles the INotifyPropertyChanged.PropertyChanged of the tasks being monitored.

This adjusts the command availability based on the task's status.

Tasks_CollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void

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

This updates the list of tasks to refelct changes to the monitored Download list.

cmsContextMenu_Copy ( object sender, EventArgs e ) : void

Handles the cmsContextMenu.ReadmeScan event.

lvwTasks_ColumnWidthChanging ( object sender, ColumnWidthChangingEventArgs e ) : void

Handles the ListView.ColumnWidthChanging event of the plugin list.

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

lvwTasks_Resize ( object sender, EventArgs e ) : void

Handles the Control.Resize event of the plugin list.

This resizes the columns to fill the list view.

lvwTasks_SelectedIndexChanged ( object sender, EventArgs e ) : void

Handles the ListView.SelectedIndexChanged event of the Download list.

Method Details

AddTaskToList() protected method

Adds the given IBackgroundTask to the view's list. If the IBackgroundTask already exists in the list, nothing is done.
protected AddTaskToList ( AddModTask p_tskTask ) : void
p_tskTask AddModTask The to add to the view's list.
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

DownloadMonitorControl() public method

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

LoadMetrics() protected method

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

OnLoad() protected method

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

SetCommandExecutableStatus() protected method

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

SizeColumnsToFit() protected method

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

UpdateTitle() protected method

Updates the control's title to reflect the current state of activities.
protected UpdateTitle ( ) : void
return void