Class ProgressIndicator
Managed controller for the native progress indicator in the status area of the main application window. Obtain one via CreateProcessIndicator(ComWrapper<ICamApiApplicationMainForm>, string), call Show() to occupy the indicator, push progress with SetPercent(int) / SetCaption(string), then dispose it (which hides the indicator and releases the underlying COM object).
Implements
Inherited Members
Namespace: CAMAPI.DotnetHelper
Assembly: CAMAPI.DotnetHelper.dll
Syntax
public sealed class ProgressIndicator : IDisposable
Properties
Caption
Current status caption
Declaration
public string Caption { get; }
Property Value
| Type | Description |
|---|---|
| string |
Percent
Current completion percent (0..100)
Declaration
public int Percent { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Dispose()
Hide the indicator and release the underlying COM object.
Declaration
public void Dispose()
Hide()
Hide the indicator and release the status bar. Throws if the indicator is not currently occupying the status bar.
Declaration
public void Hide()
RegisterHandler(string, Action<TProgressIndicatorEventType>, bool)
Register a handler invoked on progress indicator events (Show/Hide/Break/Progress). By default the callback fires asynchronously on a background thread (marshal to the UI thread before touching UI). Pass async=false to receive it synchronously on the thread raising the event — only safe when that handler does not call back into COM.
Declaration
public void RegisterHandler(string handlerIdent, Action<TProgressIndicatorEventType> onEvent, bool async = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | handlerIdent | |
| Action<TProgressIndicatorEventType> | onEvent | |
| bool | async |
SetCaption(string)
Set the status caption shown next to the indicator. Throws if the indicator is not currently occupying the status bar.
Declaration
public void SetCaption(string caption)
Parameters
| Type | Name | Description |
|---|---|---|
| string | caption |
SetPercent(int)
Set completion percent (0..100). Throws if the indicator is not currently occupying the status bar.
Declaration
public void SetPercent(int percent)
Parameters
| Type | Name | Description |
|---|---|---|
| int | percent |
Show()
Show the indicator and occupy the status bar. Throws if the status bar is already used by another running process.
Declaration
public void Show()
UnregisterHandler(string)
Unregister a previously registered progress indicator event handler.
Declaration
public void UnregisterHandler(string handlerIdent)
Parameters
| Type | Name | Description |
|---|---|---|
| string | handlerIdent |