Initializes a new Task with the specified action.
Namespace:
System.Threading.Tasks
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub New ( _ action As Action _ ) |
C# |
---|
public Task( Action action ) |
Parameters
- action
- Type: System..::.Action
The delegate that represents the code to execute in the Task.
Exceptions
Exception | Condition |
---|---|
System..::.ArgumentNullException | The action argument is null. |