C# Class ImageGlass.ImageListView.QueuedBackgroundWorker

Inheritance: System.ComponentModel.Component
Afficher le fichier Open project: d2phap/ImageGlass Class Usage Examples

Private Properties

Свойство Type Description
AddWork void
BuildWorkQueue void
ClearWorkQueue void
ClearWorkQueue void
CreateThreads void
GetWork int>.Utility.Tuple
IsWorkQueueEmpty bool
Run void
RunWorkerCompletedCallback void

Méthodes publiques

Méthode Description
CancelAsync ( ) : void

Cancels all pending operations in all queues.

CancelAsync ( int priority ) : void

Cancels all pending operations in the given queue.

CancelAsync ( object argument ) : void

Cancels processing the item with the given key.

GetApartmentState ( ) : ApartmentState

Gets the apartment state of worker threads.

Pause ( ) : void

Pauses the worker.

QueuedBackgroundWorker ( ) : System

Initializes a new instance of the QueuedBackgroundWorker class.

Resume ( ) : void

Resumes processing pending operations in the work queue.

RunWorkerAsync ( ) : void

Starts processing a new background operation.

RunWorkerAsync ( object argument ) : void

Starts processing a new background operation.

RunWorkerAsync ( object argument, int priority ) : void

Starts processing a new background operation.

RunWorkerAsync ( object argument, int priority, bool single ) : void

Starts processing a new background operation.

SetApartmentState ( ApartmentState state ) : void

Sets the apartment state of worker threads. The apartment state cannot be changed after any work is added to the work queue.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the T:System.ComponentModel.Component and optionally releases the managed resources.

OnDoWork ( ImageGlass.ImageListView.QueuedWorkerDoWorkEventArgs e ) : void

Raises the DoWork event.

OnRunWorkerCompleted ( ImageGlass.ImageListView.QueuedWorkerCompletedEventArgs e ) : void

Raises the RunWorkerCompleted event.

Private Methods

Méthode Description
AddWork ( object argument, int priority, bool single ) : void

Adds the operation to the work queue. This method must be called from inside a lock.

BuildWorkQueue ( ) : void

Rebuilds the work queue. This method must be called from inside a lock.

ClearWorkQueue ( ) : void

Clears all work queues. This method must be called from inside a lock.

ClearWorkQueue ( int priority ) : void

Clears the work queue with the given priority. This method must be called from inside a lock.

CreateThreads ( ) : void

Creates the thread array.

GetWork ( ) : int>.Utility.Tuple

Gets a pending operation from the work queue. This method must be called from inside a lock.

IsWorkQueueEmpty ( ) : bool

Determines if the work queue is empty. This method must be called from inside a lock.

Run ( ) : void

Used by the worker thread to process items.

RunWorkerCompletedCallback ( object arg ) : void

Used to call OnRunWorkerCompleted by the synchronization context.

Method Details

CancelAsync() public méthode

Cancels all pending operations in all queues.
public CancelAsync ( ) : void
Résultat void

CancelAsync() public méthode

Cancels all pending operations in the given queue.
public CancelAsync ( int priority ) : void
priority int A value between 0 and /// indicating the priority queue to cancel.
Résultat void

CancelAsync() public méthode

Cancels processing the item with the given key.
public CancelAsync ( object argument ) : void
argument object The argument of an asynchronous operation.
Résultat void

Dispose() protected méthode

Releases the unmanaged resources used by the T:System.ComponentModel.Component and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; /// false to release only unmanaged resources.
Résultat void

GetApartmentState() public méthode

Gets the apartment state of worker threads.
public GetApartmentState ( ) : ApartmentState
Résultat ApartmentState

OnDoWork() protected méthode

Raises the DoWork event.
protected OnDoWork ( ImageGlass.ImageListView.QueuedWorkerDoWorkEventArgs e ) : void
e ImageGlass.ImageListView.QueuedWorkerDoWorkEventArgs A that contains event data.
Résultat void

OnRunWorkerCompleted() protected méthode

Raises the RunWorkerCompleted event.
protected OnRunWorkerCompleted ( ImageGlass.ImageListView.QueuedWorkerCompletedEventArgs e ) : void
e ImageGlass.ImageListView.QueuedWorkerCompletedEventArgs A that contains event data.
Résultat void

Pause() public méthode

Pauses the worker.
public Pause ( ) : void
Résultat void

QueuedBackgroundWorker() public méthode

Initializes a new instance of the QueuedBackgroundWorker class.
public QueuedBackgroundWorker ( ) : System
Résultat System

Resume() public méthode

Resumes processing pending operations in the work queue.
public Resume ( ) : void
Résultat void

RunWorkerAsync() public méthode

Starts processing a new background operation.
public RunWorkerAsync ( ) : void
Résultat void

RunWorkerAsync() public méthode

Starts processing a new background operation.
public RunWorkerAsync ( object argument ) : void
argument object The argument of an asynchronous operation.
Résultat void

RunWorkerAsync() public méthode

Starts processing a new background operation.
public RunWorkerAsync ( object argument, int priority ) : void
argument object The argument of an asynchronous operation.
priority int A value between 0 and indicating the priority of this item. /// An item with a higher priority will be processed before items with lower priority.
Résultat void

RunWorkerAsync() public méthode

Starts processing a new background operation.
public RunWorkerAsync ( object argument, int priority, bool single ) : void
argument object The argument of an asynchronous operation.
priority int A value between 0 and indicating the priority of this item. /// An item with a higher priority will be processed before items with lower priority.
single bool true to run this operation without waiting for queued items; otherwise /// false to add this operatino to th queue.
Résultat void

SetApartmentState() public méthode

Sets the apartment state of worker threads. The apartment state cannot be changed after any work is added to the work queue.
public SetApartmentState ( ApartmentState state ) : void
state ApartmentState The new state of worker threads.
Résultat void