Task.WhenAny Method (Task())
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Creates a task that will complete when any of the supplied tasks have completed.
Assembly: mscorlib (in mscorlib.dll)
'Declaration Public Shared Function WhenAny ( _ ParamArray tasks As Task() _ ) As Task(Of Task)
Parameters
- tasks
- Type:
System.Threading.Tasks.Task
()
The tasks to wait on for completion.
Return Value
Type: System.Threading.Tasks.Task(Of Task)A task that represents the completion of one of the supplied tasks. The return Task's Result is the task that completed.
| Exception | Condition |
|---|---|
| ArgumentNullException | The tasks argument was null. |
| ArgumentException | The tasks array contained a null task, or was empty. |
Show: