ProgressService Class TIBCO Spotfire 6.5 API Reference
Allows operations to be executed with progress information.
Inheritance Hierarchy

System Object
  DedicatedThreadAccessible
    DedicatedThreadService
      Spotfire.Dxp.Framework.ApplicationModel ProgressService

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

public abstract class ProgressService : DedicatedThreadService
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.
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: 6.5, 6.0, 5.5, 5.0, 4.5
See Also