C# Класс SIL.FieldWorks.Common.Controls.ProgressDialogWithTask

A progress dialog (with an optional cancel button) that displays while a task runs in the background.
Наследование: IAdvInd3, IAdvInd4, IFWDisposable
Показать файл Открыть проект Примеры использования класса

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

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

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

This method is thread safe.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ImportTranslatedListsForWs ( Form parentWindow, FdoCache cache, string ws ) : void

I'd like to put all this logic into XmlTranslatedLists, because it is common to most cases of calling ImportTranslatedListsForWs, which is the point of this method. Unfortunately FDO cannot reference the DLL that has ProgressDialogWithTask. I've made it public static so that anything that references FwControls can use it at least.

ProgressDialogWithTask ( Form owner ) : System

Initializes a new instance of the ProgressDialogWithTask class that will create an actual progress dialog box to track the progress.

ProgressDialogWithTask ( ISynchronizeInvoke synchronizeInvoke ) : System

Initializes a new instance of the ProgressDialogWithTask class.

RunTask ( Func backgroundTask ) : object

If progress dialog is already showing, we run the background task using it (without creating a separate thread). Otherwise we display a new progress dialog as a modal dialog and start the background task in a separate thread.

RunTask ( bool fDisplayUi, Func backgroundTask ) : object

Displays the progress dialog as a modal dialog and starts the background task.

Step ( int cSteps ) : void

Steps the specified number of steps.

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

Метод Описание
Dispose ( bool disposing ) : void

m_progressDialog_Canceling ( object sender, System.CancelEventArgs e ) : void

Calls subscribers to the cancel event.

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

Метод Описание
AddStartListener ( ) : void
DialogShown ( ) : void
DialogShown ( object sender, EventArgs e ) : void
ImportTranslatedListsForWs ( IThreadedProgress dlg, object args ) : object

Method with required signature for ProgressDialogWithTask.RunTask, to invoke XmlTranslatedLists.ImportTranslatedListsForWs. Should only be called by the other overload of ImportTranslatedListsForWs. args must be a writing system identifier string and an FdoCache.

InitOnOwnerThread ( ) : void
LaunchDialogAndTask ( IWin32Window owner ) : void
ProgressDialogWithTask ( Form owner, ISynchronizeInvoke synchronizeInvoke ) : System

Initializes a new instance of the ProgressDialogWithTask class.

RemoveStartListener ( ) : void
RunBackgroundTask ( object sender, DoWorkEventArgs e ) : void

Executes the background task.

This method runs in the background thread!

m_progressDialog_FormClosing ( object sender, FormClosingEventArgs e ) : void
m_worker_RunWorkerCompleted ( object sender, RunWorkerCompletedEventArgs e ) : void

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

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

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
This method is thread safe.
public CheckDisposed ( ) : void
Результат void

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

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

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

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

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

I'd like to put all this logic into XmlTranslatedLists, because it is common to most cases of calling ImportTranslatedListsForWs, which is the point of this method. Unfortunately FDO cannot reference the DLL that has ProgressDialogWithTask. I've made it public static so that anything that references FwControls can use it at least.
public static ImportTranslatedListsForWs ( Form parentWindow, FdoCache cache, string ws ) : void
parentWindow System.Windows.Forms.Form
cache FdoCache
ws string
Результат void

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

Initializes a new instance of the ProgressDialogWithTask class that will create an actual progress dialog box to track the progress.
public ProgressDialogWithTask ( Form owner ) : System
owner System.Windows.Forms.Form The form to use as the owner when creating the actual progress /// dialog.
Результат System

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

Initializes a new instance of the ProgressDialogWithTask class.
public ProgressDialogWithTask ( ISynchronizeInvoke synchronizeInvoke ) : System
synchronizeInvoke ISynchronizeInvoke
Результат System

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

If progress dialog is already showing, we run the background task using it (without creating a separate thread). Otherwise we display a new progress dialog as a modal dialog and start the background task in a separate thread.
Wraps any exception thrown by the background /// task
public RunTask ( Func backgroundTask ) : object
backgroundTask Func The background task.
Результат object

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

Displays the progress dialog as a modal dialog and starts the background task.
Wraps any exception thrown by the background /// task
public RunTask ( bool fDisplayUi, Func backgroundTask ) : object
fDisplayUi bool set to true to display the progress dialog, /// false to run without UI.
backgroundTask Func The background task.
Результат object

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

Steps the specified number of steps.
public Step ( int cSteps ) : void
cSteps int The count of steps. If it's 0, step the default step size
Результат void

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

Calls subscribers to the cancel event.
protected m_progressDialog_Canceling ( object sender, System.CancelEventArgs e ) : void
sender object The sender.
e System.CancelEventArgs The instance containing the event data.
Результат void