Show / Hide Table of Contents

Interface IPromise<T>

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

Inherited Members
IPromise.IsRejected
IPromise.IsResolved
IPromise.PercentComplete
IPromise.Done(Action<Object>)
ICancelable.Cancel()
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public interface IPromise<T> : IPromise, ICancelable
Type Parameters
Name Description
T
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

Value

The result of the promise. Only valid if IsResolved is true

Declaration
T Value { get; }
Property Value
Type Description
T

Methods

| Improve this Doc View Source

Always(Action)

Callback to be executed when the promise completes regardless of whether an error occurred

Declaration
IPromise<T> Always(Action callback)
Parameters
Type Name Description
System.Action callback

Callback to be executed

Returns
Type Description
IPromise<T>

The current instance for chaining additional calls

| Improve this Doc View Source

Done(Action<T>)

Callback to be executed when the promise completes successfully

Declaration
IPromise<T> Done(Action<T> callback)
Parameters
Type Name Description
System.Action<T> callback

Callback to be executed with the result of the promise

Returns
Type Description
IPromise<T>

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<T> 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<T>

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<T> 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<T>

The current instance for chaining additional calls

Extension Methods

Promises.Cancelled<T>(IPromise<T>, Action<OperationCanceledException>)
Promises.Continue<T, S>(IPromise<T>, Func<T, IPromise<S>>)
Promises.Convert<T, S>(IPromise<T>, Func<T, S>)
Promises.Convert<T, S>(IPromise<T>, Action<T, Promise<S>>, Action<Exception, Promise<S>>)
Promises.Error<T>(IPromise<T>, Action<Exception>)
Promises.Error<TErr, T>(IPromise<T>, Action<TErr>)
Promises.FailOver<T>(IPromise<T>, Func<IPromise<T>>)
Promises.WithInvoker<T>(IPromise<T>, Action<Delegate, Object[]>)
Promises.ToTask<T>(IPromise<T>, CancellationToken)
Promises.GetAwaiter<T>(IPromise<T>)
Promises.ConfigureAwait<T>(IPromise<T>, Boolean)
Promises.Wait<T>(IPromise<T>)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX