Allows operations to be executed with progress information.
Inheritance Hierarchy
DedicatedThreadAccessible
DedicatedThreadService
Spotfire.Dxp.Framework.ApplicationModelProgressService
Namespace: Spotfire.Dxp.Framework.ApplicationModel
Assembly: Spotfire.Dxp.Framework (in Spotfire.Dxp.Framework.dll) Version: 30.0.11525.4184 (30.0.11525.4184)
Syntax
C#
public abstract class ProgressService : DedicatedThreadService
The ProgressService type exposes the following members.
Methods
Name | Description | |
---|---|---|
ExecuteWithProgress |
Creates a new Progress object and executes the given
top-level operation in the context of that
progress.
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
Properties
Name | Description | |
---|---|---|
BackgroundProgresses |
Gets the progress operations currently running in the background.
| |
CurrentProgress | Gets the progress object associated to the executing thread to which progress
can be reported. The progress object is typically created
through a call to ExecuteWithProgress(String, String, ProgressOperation).
If no such call has been made a default progress object is returned. Any progress that is
reported to the default progress is ignored
|
Remarks
This class cannot be extended through inheritance.
Examples
C#
ProgressService progressService = GetService<ProgressService>(); progressService.ExecuteWithProgress("Opening File", "Task description", delegate { // Do some work // ... ProgressService.CurrentProgress.ExecuteSubtask( "Sub task", stepCount, "Step {0} of {1}", delegate { try { // Perform sub task for (int i = 0; i < stepCount; i++) { // Do something // ... ProgressService.CurrentProgress.TryReportProgress(); ProgressService.CurrentProgress.CheckCancel(); } } catch (CanceledException) { // Handle exception } finally { // Perform Cleanup } }); // Do more work // ... }
Version Information
See Also