C# Class Habanero.Base.HabaneroBackgroundWorker

Helper class to facilitate asynchronous workers on pre-dotnet-4.5 machines, using the native system threading model and an abstraction for synchronisation with the UI thread for user feedback on completion and exception
Show file Open project: Chillisoft/habanero Class Usage Examples

Public Methods

Method Description
Run ( IActionDispatcher dispatcher, object>.ConcurrentDictionary data, BackgroundWorkerMethodDelegate backgroundWorker, UIWorkerMethodDelegate onSuccess, UIWorkerMethodDelegate onCancel, BackgroundWorkerExceptionHandlerDelegate onException ) : HabaneroBackgroundWorker

Convenience method for creating an HabaneroBackgroundWorker.

Run ( ) : void

Starts the new thread.

WaitForBackgroundWorkerToComplete ( ) : void

Waits for the thread to end.

Private Methods

Method Description
RunBackgroundWorker ( ) : void
RunExceptionDelegate ( Exception ex ) : void
RunUIWorkerDelegate ( bool success ) : void

Method Details

Run() public static method

Convenience method for creating an HabaneroBackgroundWorker.
public static Run ( IActionDispatcher dispatcher, object>.ConcurrentDictionary data, BackgroundWorkerMethodDelegate backgroundWorker, UIWorkerMethodDelegate onSuccess, UIWorkerMethodDelegate onCancel, BackgroundWorkerExceptionHandlerDelegate onException ) : HabaneroBackgroundWorker
dispatcher IActionDispatcher
data object>.ConcurrentDictionary
backgroundWorker BackgroundWorkerMethodDelegate
onSuccess UIWorkerMethodDelegate
onCancel UIWorkerMethodDelegate
onException BackgroundWorkerExceptionHandlerDelegate
return HabaneroBackgroundWorker

Run() public method

Starts the new thread.
public Run ( ) : void
return void

WaitForBackgroundWorkerToComplete() public method

Waits for the thread to end.
public WaitForBackgroundWorkerToComplete ( ) : void
return void