Interface IPromise
Represents a promise that a result will be provided at some point in the future
Inherited Members
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public interface IPromise : ICancelable
Remarks
A promise is very similar to a System.Threading.Tasks.Task and can be awaited just like a task. The API of a promise is very similar to that of a JQuery Promise
Properties
| Improve this Doc View SourceIsRejected
Whether an error occurred causing the promise to be rejected
Declaration
bool IsRejected { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsResolved
Whether the promise completed successfully
Declaration
bool IsResolved { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
PercentComplete
The progress of the promise represented as an integer from 0 to 100
Declaration
int PercentComplete { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Value
The result of the promise. Only valid if IsResolved is true
Declaration
object Value { get; }
Property Value
Type | Description |
---|---|
System.Object |
Methods
| Improve this Doc View SourceAlways(Action)
Callback to be executed when the promise completes regardless of whether an error occurred
Declaration
IPromise Always(Action callback)
Parameters
Type | Name | Description |
---|---|---|
System.Action | callback | Callback to be executed |
Returns
Type | Description |
---|---|
IPromise | The current instance for chaining additional calls |
Done(Action<Object>)
Callback to be executed when the promise completes successfully
Declaration
IPromise Done(Action<object> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Object> | callback | Callback to be executed with the result of the promise |
Returns
Type | Description |
---|---|
IPromise | The current instance for chaining additional calls |
Fail(Action<Exception>)
Callback to be executed when the promise encounters an error
Declaration
IPromise Fail(Action<Exception> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Exception> | callback | Callback to be executed with the exception of the promise |
Returns
Type | Description |
---|---|
IPromise | The current instance for chaining additional calls |
Progress(Action<Int32, String>)
Callback to be executed when the reported progress changes
Declaration
IPromise Progress(Action<int, string> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Int32, System.String> | callback | Callback to be executed with the progress [0, 100] and the message |
Returns
Type | Description |
---|---|
IPromise | The current instance for chaining additional calls |