ProgressService Class

Spotfire 14.3 API Reference
Allows operations to be executed with progress information.
Inheritance Hierarchy

SystemObject
  DedicatedThreadAccessible
    DedicatedThreadService
      Spotfire.Dxp.Framework.ApplicationModelProgressService

Namespace:  Spotfire.Dxp.Framework.ApplicationModel
Assembly:  Spotfire.Dxp.Framework (in Spotfire.Dxp.Framework.dll) Version: 65.0.19510.3242 (65.0.19510.3242)
Syntax

C#
public abstract class ProgressService : DedicatedThreadService

The ProgressService type exposes the following members.

Properties

  NameDescription
Public propertyBackgroundProgresses
Gets the progress operations currently running in the background.
Public propertyStatic memberCurrentProgress
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
Top
Methods

  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExecuteWithProgress
Creates a new Progress object and executes the given top-level operation in the context of that progress.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

An instance of this class is available as a service and can be accessed through the GetService() method available on all document nodes and on the AnalysisApplication.

This class cannot be extended through inheritance.

Examples

The following example shows an operation containing a sub task being executed with progress.
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

Supported in: 14.3, 14.2, 14.1, 14.0, 12.5, 12.4, 12.3, 12.2, 12.1, 12.0, 11.8
See Also

Reference