The given Action will be performed when the task ends.

Namespace: UnityThreading
Assembly: UnityThreading (in UnityThreading.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public static Task<T> WhenEnded<T>(
	this Task<T> task,
	Action<Task<T>> action
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function WhenEnded(Of T) ( _
	task As Task(Of T), _
	action As Action(Of Task(Of T)) _
) As Task(Of T)
Visual C++
[ExtensionAttribute]
public:
generic<typename T>
static Task<T>^ WhenEnded(
	Task<T>^ task, 
	Action<Task<T>^>^ action
)

Parameters

task
Type: UnityThreading..::..Task<(Of <(<'T>)>)>
action
Type: System..::..Action<(Of <(<'Task<(Of <(<'T>)>)>>)>)>
The action to perform.

Type Parameters

T

Return Value

This task.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Task<(Of <(<'T>)>)>. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also