Click or drag to resize

BackgroundCalculation Class

Used to perform a computation in the background. This is modeled after BackgroundWorker, with a few important differences.
Inheritance Hierarchy

Namespace:  AGI.Foundation.Infrastructure.Threading
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.1.418.0 (24.1.418.0)
Syntax
public class BackgroundCalculation : BackgroundWorker, 
	ITrackCalculationProgress

The BackgroundCalculation type exposes the following members.

Constructors
  NameDescription
Public methodBackgroundCalculation
Initializes a new instance. Also captures the CalculationContext from the thread constructing the new instance in order to pass the context to the new thread when RunWorkerAsync is called. To capture the context again later, call CaptureCalculationContext.
Top
Properties
  NameDescription
Public propertyAsyncWaitHandle
Gets a WaitHandle that is used to wait for the operation to complete. When the DoWork event handler has finished, this event will be signaled.
Public propertyCancellationPending
Gets a value indicating whether the application has requested cancellation of a background operation.
Protected propertyCanRaiseEvents
Gets a value indicating whether the component can raise an event.
(Inherited from Component.)
Public propertyContainer
Gets the IContainer that contains the Component.
(Inherited from Component.)
Protected propertyDesignMode
Gets a value that indicates whether the Component is currently in design mode.
(Inherited from Component.)
Protected propertyEvents
Gets the list of event handlers that are attached to this Component.
(Inherited from Component.)
Public propertyIsBusy
Gets a value indicating whether the BackgroundWorker is running an asynchronous operation.
(Inherited from BackgroundWorker.)
Public propertySite
Gets or sets the ISite of the Component.
(Inherited from Component.)
Public propertyWorkerReportsProgress
Gets or sets a value indicating whether the BackgroundWorker can report progress updates.
(Inherited from BackgroundWorker.)
Public propertyWorkerSupportsCancellation
Gets or sets a value indicating whether the BackgroundWorker supports asynchronous cancellation.
(Inherited from BackgroundWorker.)
Top
Methods
  NameDescription
Public methodCancelAsync
Requests cancellation of a pending background operation.
(Inherited from BackgroundWorker.)
Public methodCaptureCalculationContext
Captures the calculation context of the calling thread. This is the context that will be passed to the new thread when RunWorkerAsync is called. This method cannot be called after RunWorkerAsync.
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodDispose
Releases all resources used by the Component.
(Inherited from Component.)
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the Component and optionally releases the managed resources.
(Inherited from Component.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
(Inherited from Component.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodGetService
Returns an object that represents a service provided by the Component or by its Container.
(Inherited from Component.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodMemberwiseClone(Boolean)
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.)
Protected methodOnDoWork
Raises the DoWork event.
(Overrides BackgroundWorkerOnDoWork(DoWorkEventArgs).)
Protected methodOnProgressChanged
Raises the ProgressChanged event.
(Inherited from BackgroundWorker.)
Protected methodOnRunWorkerCompleted
Raises the RunWorkerCompleted event.
(Overrides BackgroundWorkerOnRunWorkerCompleted(RunWorkerCompletedEventArgs).)
Public methodReportProgress(Int32)
Raises the ProgressChanged event.
(Inherited from BackgroundWorker.)
Public methodReportProgress(Int32, Object)
Raises the ProgressChanged event.
Public methodRunWorkerAsync
Starts execution of a background operation.
(Inherited from BackgroundWorker.)
Public methodRunWorkerAsync(Object)
Starts execution of a background operation.
(Inherited from BackgroundWorker.)
Public methodToString
Returns a String containing the name of the Component, if any. This method should not be overridden.
(Inherited from Component.)
Top
Events
  NameDescription
Public eventDisposed
Occurs when the component is disposed by a call to the Dispose method.
(Inherited from Component.)
Public eventDoWork (Inherited from BackgroundWorker.)
Public eventProgressChanged
Occurs when ReportProgress(Int32) is called.
(Inherited from BackgroundWorker.)
Public eventRunWorkerCompleted
Occurs when the background operation has completed, has been canceled, or has raised an exception.
(Inherited from BackgroundWorker.)
Top
Remarks

This type differs from BackgroundWorker in the following ways:

See Also