Show / Hide Table of Contents

Interface IPromise

Represents a promise that a result will be provided at some point in the future

Inherited Members
ICancelable.Cancel()
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 Source

IsRejected

Whether an error occurred causing the promise to be rejected

Declaration
bool IsRejected { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsResolved

Whether the promise completed successfully

Declaration
bool IsResolved { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

PercentComplete

The progress of the promise represented as an integer from 0 to 100

Declaration
int PercentComplete { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

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 Source

Always(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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX