WorkManager<T> Class

Helper class to handle WorkUnits work.
Public Class WorkManager(Of  _ 
T As WorkUnit
Implements IDisposable
This language is not supported or no code example is available.
public class WorkManager<T> : IDisposable 
where T : WorkUnit
This language is not supported or no code example is available.

Type Parameters

T

Name Description
Public constructor WorkManager() Standard constructor.
Public constructor WorkManager(IEnumerable<T>) Constructor with a collection of WorkUnits.
Public constructor WorkManager(T) Constructor with a single WorkUnit.
Top
Name Description
Public property IsQueueEmpty Indicates whether the queue is empty or not.
Public property QueueCount Gets the number of WorkUnits.
Top
Methods
 
Name Description
Public method AppendToQueue(IEnumerable<T>) Appends a collection of WorkUnit to the working queue.
Public method AppendToQueue(T) Appends a WorkUnit to the working queue.
Public method Cancel() Cancels the current WorkUnit work.
Public method ClearQueue() Clears the queue.
Public method Dispose() Stops the current work, clear the queue, and release every resource.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (inherited from Object).
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (inherited from Object).
Public method GetHashCode Serves as the default hash function. (inherited from Object).
Public method GetQueueItems() Gets the queue of WorkUnits.
Public method GetType Gets the Type of the current instance. (inherited from Object).
Protected method MemberwiseClone Creates a shallow copy of the current Object. (inherited from Object).
Public method RemoveFromQueue(T) Removes a WorkUnit from the working queue.
Public method RemoveFromQueue(workUnitStatus) Removes all the WorkUnits from the working queue according to their status.
Public method Reset() Stops the current work and clear the queue.
Public method Run() Runs the first WorkUnit synchronously.
Public method Run(Environment) Runs the first WorkUnit asynchronously.
Public method RunAll() Runs all the WorkUnits of the queue one-by-one synchronously.
Public method RunAll(Environment) Runs all the WorkUnits of the queue one-by-one asynchronously.
Public method ToString Returns a string that represents the current object. (inherited from Object).
Top
Events
 
Name Description
Public event WorkManager.QueueCancelled Occurs when the background work is cancelled.
Public event WorkManager.QueueCompleted Occurs when the background work of a single WorkUnit is completed.
Public event WorkManager.WorkUnitCompleted Occurs when the background work of a single WorkUnit is completed.
Public event WorkManager.WorkUnitFailed Occurs when the background work of a single WorkUnit is completed.
Top
Name Description
Public delegate QueueCancelledEventHandler Represents the method that will handle the WorkManager.QueueCancelled event.
Public delegate QueueCompletedEventHandler Represents the method that will handle the WorkManager.QueueCompleted event.
Public delegate WorkUnitCompletedEventHandler Represents the method that will handle the WorkManager.WorkUnitCompleted event.
Public delegate WorkUnitFailedEventHandler Represents the method that will handle the WorkManager.WorkUnitFailed event.
Top
devDept.Eyeshot.WorkManager<T>

.NET Framework

Supported in: 4.8

In this article

Definition