TaskFactory TaskFactory TaskFactory TaskFactory Constructors

Definition

Overloads

TaskFactory() TaskFactory() TaskFactory()

Initializes a TaskFactory instance with the default configuration.

TaskFactory(CancellationToken) TaskFactory(CancellationToken) TaskFactory(CancellationToken)

Initializes a TaskFactory instance with the specified configuration.

TaskFactory(TaskScheduler) TaskFactory(TaskScheduler) TaskFactory(TaskScheduler) TaskFactory(TaskScheduler)

Initializes a TaskFactory instance with the specified configuration.

TaskFactory(TaskCreationOptions, TaskContinuationOptions) TaskFactory(TaskCreationOptions, TaskContinuationOptions) TaskFactory(TaskCreationOptions, TaskContinuationOptions) TaskFactory(TaskCreationOptions, TaskContinuationOptions)

Initializes a TaskFactory instance with the specified configuration.

TaskFactory(CancellationToken, TaskCreationOptions, TaskContinuationOptions, TaskScheduler) TaskFactory(CancellationToken, TaskCreationOptions, TaskContinuationOptions, TaskScheduler) TaskFactory(CancellationToken, TaskCreationOptions, TaskContinuationOptions, TaskScheduler)

Initializes a TaskFactory instance with the specified configuration.

TaskFactory() TaskFactory() TaskFactory()

Initializes a TaskFactory instance with the default configuration.

public:
 TaskFactory();
public TaskFactory ();
Public Sub New ()

Remarks

This constructor creates a TaskFactory instance with a default configuration. The TaskCreationOptions property is initialized to None, the TaskContinuationOptions property is initialized to None, and the TaskScheduler property is initialized to the current scheduler (see Current).

See also

TaskFactory(CancellationToken) TaskFactory(CancellationToken) TaskFactory(CancellationToken)

Initializes a TaskFactory instance with the specified configuration.

public:
 TaskFactory(System::Threading::CancellationToken cancellationToken);
public TaskFactory (System.Threading.CancellationToken cancellationToken);
new System.Threading.Tasks.TaskFactory : System.Threading.CancellationToken -> System.Threading.Tasks.TaskFactory

Parameters

cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

The CancellationToken that will be assigned to tasks created by this TaskFactory unless another CancellationToken is explicitly specified while calling the factory methods.

Remarks

This constructor creates a TaskFactory instance with a default configuration. The TaskCreationOptions property is initialized to None, the TaskContinuationOptions property is initialized to None, and the TaskScheduler property is initialized to the current scheduler (see Current).

See also

TaskFactory(TaskScheduler) TaskFactory(TaskScheduler) TaskFactory(TaskScheduler) TaskFactory(TaskScheduler)

Initializes a TaskFactory instance with the specified configuration.

public:
 TaskFactory(System::Threading::Tasks::TaskScheduler ^ scheduler);
public TaskFactory (System.Threading.Tasks.TaskScheduler scheduler);
new System.Threading.Tasks.TaskFactory : System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.TaskFactory
Public Sub New (scheduler As TaskScheduler)

Parameters

scheduler
TaskScheduler TaskScheduler TaskScheduler TaskScheduler

The TaskScheduler to use to schedule any tasks created with this TaskFactory. A null value indicates that the current TaskScheduler should be used.

Remarks

With this constructor, the TaskCreationOptions property is initialized to None, the TaskContinuationOptions property is initialized to None, and the TaskScheduler property is initialized to scheduler, unless it's null, in which case the property is initialized to the current scheduler (see Current).

See also

TaskFactory(TaskCreationOptions, TaskContinuationOptions) TaskFactory(TaskCreationOptions, TaskContinuationOptions) TaskFactory(TaskCreationOptions, TaskContinuationOptions) TaskFactory(TaskCreationOptions, TaskContinuationOptions)

Initializes a TaskFactory instance with the specified configuration.

public:
 TaskFactory(System::Threading::Tasks::TaskCreationOptions creationOptions, System::Threading::Tasks::TaskContinuationOptions continuationOptions);
public TaskFactory (System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskContinuationOptions continuationOptions);
new System.Threading.Tasks.TaskFactory : System.Threading.Tasks.TaskCreationOptions * System.Threading.Tasks.TaskContinuationOptions -> System.Threading.Tasks.TaskFactory
Public Sub New (creationOptions As TaskCreationOptions, continuationOptions As TaskContinuationOptions)

Parameters

creationOptions
TaskCreationOptions TaskCreationOptions TaskCreationOptions TaskCreationOptions

The default TaskCreationOptions to use when creating tasks with this TaskFactory.

continuationOptions
TaskContinuationOptions TaskContinuationOptions TaskContinuationOptions TaskContinuationOptions

The default TaskContinuationOptions to use when creating continuation tasks with this TaskFactory.

Exceptions

The creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions).

-or-

The continuationOptions argument specifies an invalid value.

Remarks

With this constructor, the TaskCreationOptions property is initialized to creationOptions, the TaskContinuationOptions property is initialized to continuationOptions, and the TaskScheduler property is initialized to the current scheduler (see Current).

See also

TaskFactory(CancellationToken, TaskCreationOptions, TaskContinuationOptions, TaskScheduler) TaskFactory(CancellationToken, TaskCreationOptions, TaskContinuationOptions, TaskScheduler) TaskFactory(CancellationToken, TaskCreationOptions, TaskContinuationOptions, TaskScheduler)

Initializes a TaskFactory instance with the specified configuration.

public:
 TaskFactory(System::Threading::CancellationToken cancellationToken, System::Threading::Tasks::TaskCreationOptions creationOptions, System::Threading::Tasks::TaskContinuationOptions continuationOptions, System::Threading::Tasks::TaskScheduler ^ scheduler);
public TaskFactory (System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
new System.Threading.Tasks.TaskFactory : System.Threading.CancellationToken * System.Threading.Tasks.TaskCreationOptions * System.Threading.Tasks.TaskContinuationOptions * System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.TaskFactory

Parameters

cancellationToken
CancellationToken CancellationToken CancellationToken CancellationToken

The default CancellationToken that will be assigned to tasks created by this TaskFactory unless another CancellationToken is explicitly specified while calling the factory methods.

creationOptions
TaskCreationOptions TaskCreationOptions TaskCreationOptions TaskCreationOptions

The default TaskCreationOptions to use when creating tasks with this TaskFactory.

continuationOptions
TaskContinuationOptions TaskContinuationOptions TaskContinuationOptions TaskContinuationOptions

The default TaskContinuationOptions to use when creating continuation tasks with this TaskFactory.

scheduler
TaskScheduler TaskScheduler TaskScheduler TaskScheduler

The default TaskScheduler to use to schedule any Tasks created with this TaskFactory. A null value indicates that TaskScheduler.Current should be used.

Exceptions

The creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions).

-or-

The continuationOptions argument specifies an invalid value.

Remarks

With this constructor, the TaskCreationOptions property is initialized to creationOptions, the TaskContinuationOptions property is initialized to continuationOptions, and the TaskScheduler property is initialized to scheduler, unless it's null, in which case the property is initialized to the current scheduler (see Current).

See also

Applies to