C# Класс Nexus.Client.BackgroundTasks.UI.ProgressDialog

This is a window that displays the progress of a IBackgroundTask
Наследование: System.Windows.Forms.Form
Показать файл Открыть проект

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

Метод Описание
ShowDialog ( IBackgroundTask p_bgtTask ) : DialogResult

Shows the progress dialog as a modal window.

ShowDialog ( IWin32Window p_winOwner, IBackgroundTask p_bgtTask ) : DialogResult

Shows the progress dialog as a modal window that is a child of the given owner.

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

Метод Описание
OnClosing ( CancelEventArgs e ) : void

Raises the Form.Closing event.

This prevents the form from closing until the task has completed.

OnShown ( EventArgs e ) : void

Raises the Form.Shown event.

This immediately closes the form if the task has already completed.

ProgressDialog ( IBackgroundTask p_bgtTask ) : System

A simple constructor that initializes the object with the given values.

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

Метод Описание
DoDispose ( ) : void

Allows extension of the dispose method.

This unwires listeners that are wired to object on other threads. This is because if the form is closed before the threads are finished the threads may raise events to which we are listening, which will cause access to the control after it has been disposed (which will raise an exception).

HandleChangedProperty ( string p_strPropertyName ) : void

Updates the form to display the changed property.

Task_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Handles the INotifyPropertyChanged.PropertyChanged event of the task.

This updates the progress bars and messages.

Task_TaskEnded ( object sender, TaskEndedEventArgs e ) : void

Handles the IBackgroundTask.TaskEnded event of the task.

This sets the Form.DialogResult, dependant upon whether or not the task was cancelled.

butCancel_Click ( object sender, EventArgs e ) : void

Handles the Control.Click event of the cancel button.

This asks the BackgroundWorker to cancel. It also disables the cancel button to let the user know the process is cancelling.

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

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

Raises the Form.Closing event.
This prevents the form from closing until the task has completed.
protected OnClosing ( CancelEventArgs e ) : void
e CancelEventArgs A describing the event arguments.
Результат void

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

Raises the Form.Shown event.
This immediately closes the form if the task has already completed.
protected OnShown ( EventArgs e ) : void
e System.EventArgs An describing the event arguments.
Результат void

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

A simple constructor that initializes the object with the given values.
protected ProgressDialog ( IBackgroundTask p_bgtTask ) : System
p_bgtTask IBackgroundTask The whose progress is to be displayed.
Результат System

ShowDialog() публичный статический Метод

Shows the progress dialog as a modal window.
public static ShowDialog ( IBackgroundTask p_bgtTask ) : DialogResult
p_bgtTask IBackgroundTask The whose progress is to be displayed.
Результат DialogResult

ShowDialog() публичный статический Метод

Shows the progress dialog as a modal window that is a child of the given owner.
public static ShowDialog ( IWin32Window p_winOwner, IBackgroundTask p_bgtTask ) : DialogResult
p_winOwner IWin32Window The owner of the dialog.
p_bgtTask IBackgroundTask The whose progress is to be displayed.
Результат DialogResult