CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.Threading.BackgroundWorker Class Reference

A BackgroundWorker that wraps a System.ComponentModel.BackgroundWorkertransfers ApplicationContext.User, ClientContext, GlobalContext, CurrentCulture and CurrentUICulture to the background thread. More...

Inheritance diagram for Csla.Threading.BackgroundWorker:

Public Member Functions

 BackgroundWorker ()
 Initializes a new instance of the BackgroundWorker class. More...
 
void CancelAsync ()
 Request cancelation of async operation. More...
 
void RunWorkerAsync ()
 Starts execution of a background operation. More...
 
void RunWorkerAsync (object argument)
 Starts execution of a background operation. More...
 
void ReportProgress (int percentProgress)
 Calls report progress on the underlying background worker. More...
 
void ReportProgress (int percentProgress, object userState)
 Calls report progress on the background worker. More...
 

Properties

DoWorkEventHandler DoWork
 Occurs when M:System.ComponentModel.BackgroundWorker.RunWorkerAsync is called. More...
 
RunWorkerCompletedEventHandler RunWorkerCompleted
 Occurs when the background operation has completed, has been canceled, or has raised an exception. More...
 
ProgressChangedEventHandler ProgressChanged
 Occurs when M:System.ComponentModel.BackgroundWorker.ReportProgress is called. More...
 
bool IsBusy [get]
 Gets a value indicating whether the T:System.ComponentModel.BackgroundWorker is running an asynchronous operation. More...
 
bool WorkerReportsProgress [getset]
 Gets or sets a value indicating whether the T:System.ComponentModel.BackgroundWorker can report progress updates. More...
 
bool WorkerSupportsCancellation [getset]
 Gets or sets a value indicating whether the T:System.ComponentModel.BackgroundWorker supports asynchronous cancellation. More...
 
bool CancellationPending [get]
 Gets a value indicating whether the application has requested cancellation of a background operation. More...
 
Csla.Core.ContextDictionary GlobalContext [get]
 Gets a reference to the global context returned from the background thread and/or server. More...
 

Detailed Description

A BackgroundWorker that wraps a System.ComponentModel.BackgroundWorkertransfers ApplicationContext.User, ClientContext, GlobalContext, CurrentCulture and CurrentUICulture to the background thread.

Definition at line 19 of file BackgroundWorker.cs.

Constructor & Destructor Documentation

◆ BackgroundWorker()

Csla.Threading.BackgroundWorker.BackgroundWorker ( )

Initializes a new instance of the BackgroundWorker class.

Definition at line 25 of file BackgroundWorker.cs.

Member Function Documentation

◆ CancelAsync()

void Csla.Threading.BackgroundWorker.CancelAsync ( )

Request cancelation of async operation.

Exceptions
T:System.InvalidOperationExceptionP:System.ComponentModel.BackgroundWorker.WorkerSupportsCancellation is false.

<PermissionSet> <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"> </PermissionSet>

Definition at line 145 of file BackgroundWorker.cs.

◆ ReportProgress() [1/2]

void Csla.Threading.BackgroundWorker.ReportProgress ( int  percentProgress)

Calls report progress on the underlying background worker.

Parameters
percentProgressThe percentage, from 0 to 100, of the background operation that is complete.

Definition at line 329 of file BackgroundWorker.cs.

◆ ReportProgress() [2/2]

void Csla.Threading.BackgroundWorker.ReportProgress ( int  percentProgress,
object  userState 
)

Calls report progress on the background worker.

Parameters
percentProgressThe percent progress.
userStateUser state object.

Definition at line 339 of file BackgroundWorker.cs.

◆ RunWorkerAsync() [1/2]

void Csla.Threading.BackgroundWorker.RunWorkerAsync ( )

Starts execution of a background operation.

Exceptions
T:System.InvalidOperationExceptionP:System.ComponentModel.BackgroundWorker.IsBusy is true.

<PermissionSet> <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"> </PermissionSet>

Definition at line 215 of file BackgroundWorker.cs.

◆ RunWorkerAsync() [2/2]

void Csla.Threading.BackgroundWorker.RunWorkerAsync ( object  argument)

Starts execution of a background operation.

Parameters
argumentA parameter for use by the background operation to be executed in the E:System.ComponentModel.BackgroundWorker.DoWork event handler.
Exceptions
T:System.InvalidOperationExceptionP:System.ComponentModel.BackgroundWorker.IsBusy is true.

Definition at line 227 of file BackgroundWorker.cs.

Property Documentation

◆ CancellationPending

bool Csla.Threading.BackgroundWorker.CancellationPending
get

Gets a value indicating whether the application has requested cancellation of a background operation.

Returns
true if the application has requested cancellation of a background operation; otherwise, false. The default is false.

Definition at line 156 of file BackgroundWorker.cs.

◆ DoWork

DoWorkEventHandler Csla.Threading.BackgroundWorker.DoWork
addremove

Occurs when M:System.ComponentModel.BackgroundWorker.RunWorkerAsync is called.

Definition at line 41 of file BackgroundWorker.cs.

◆ GlobalContext

Csla.Core.ContextDictionary Csla.Threading.BackgroundWorker.GlobalContext
get

Gets a reference to the global context returned from the background thread and/or server.

Definition at line 200 of file BackgroundWorker.cs.

◆ IsBusy

bool Csla.Threading.BackgroundWorker.IsBusy
get

Gets a value indicating whether the T:System.ComponentModel.BackgroundWorker is running an asynchronous operation.

Returns
true, if the T:System.ComponentModel.BackgroundWorker is running an asynchronous operation; otherwise, false.

Definition at line 92 of file BackgroundWorker.cs.

◆ ProgressChanged

ProgressChangedEventHandler Csla.Threading.BackgroundWorker.ProgressChanged
addremove

Occurs when M:System.ComponentModel.BackgroundWorker.ReportProgress is called.

Definition at line 74 of file BackgroundWorker.cs.

◆ RunWorkerCompleted

RunWorkerCompletedEventHandler Csla.Threading.BackgroundWorker.RunWorkerCompleted
addremove

Occurs when the background operation has completed, has been canceled, or has raised an exception.

Definition at line 57 of file BackgroundWorker.cs.

◆ WorkerReportsProgress

bool Csla.Threading.BackgroundWorker.WorkerReportsProgress
getset

Gets or sets a value indicating whether the T:System.ComponentModel.BackgroundWorker can report progress updates.

Returns
true if the T:System.ComponentModel.BackgroundWorker supports progress updates; otherwise false. The default is false.

Definition at line 106 of file BackgroundWorker.cs.

◆ WorkerSupportsCancellation

bool Csla.Threading.BackgroundWorker.WorkerSupportsCancellation
getset

Gets or sets a value indicating whether the T:System.ComponentModel.BackgroundWorker supports asynchronous cancellation.

Returns
true if the T:System.ComponentModel.BackgroundWorker supports cancellation; otherwise false. The default is false.

Definition at line 124 of file BackgroundWorker.cs.