ProgressService Class TIBCO Spotfire 6.0 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: 13.19.7018.3940 (13.19.7018.3940)
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 
        // ...
    }
See Also