Table of Contents

Class ValueSource<T>

Namespace
Acuit.Pinpoint.Workflows
Assembly
Acuit.Pinpoint.Workflows.dll

An workflow value source.

[TypeConverter(typeof(ValueSourceTypeConverter))]
public abstract class ValueSource<T> : ValueSource

Type Parameters

T

The value type.

Inheritance
ValueSource<T>
Derived
Inherited Members

Remarks

ValueSource<T> of type object should generally not be used for workflow type properties, preferring ValueSource instead so that assignments in XAML and implicit conversions in code work as expected.

Constructors

ValueSource()

protected ValueSource()

Methods

EvaluateAsObjectAsync(ActivityContext, CancellationToken)

Evaluates the value.

public override sealed Task<object?> EvaluateAsObjectAsync(ActivityContext context, CancellationToken cancellationToken = default)

Parameters

context ActivityContext

The activity context.

cancellationToken CancellationToken

A token that can request cancelling the evaluation.

Returns

Task<object>

The task object representing the asynchronous operation.

Remarks

Once the operation completes, the Result property on the returned task object contains the resulting value.

Exceptions

ArgumentNullException

context is null.

Exception

The value could not be evaluated. Possible exceptions depend on the implementation.

EvaluateAsync(ActivityContext, CancellationToken)

Evaluates the value.

public abstract Task<T> EvaluateAsync(ActivityContext context, CancellationToken cancellationToken = default)

Parameters

context ActivityContext

The activity context.

cancellationToken CancellationToken

A token that can request cancelling the evaluation.

Returns

Task<T>

A task that represents the asynchronous operation. The value of its Result property contains the resulting value.

Exceptions

ArgumentNullException

context is null.

Exception

The value could not be evaluated. Possible exceptions depend on the implementation.

Operators

implicit operator ValueSource<T>(T)

Defines an implicit conversion of a constant value to a ValueSource<T> of the value type.

public static implicit operator ValueSource<T>(T value)

Parameters

value T

The constant value.

Returns

ValueSource<T>