TaskFactory<TResult> Constructor (TaskCreationOptions, TaskContinuationOptions)

Initializes a TaskFactory<TResult> instance with the specified configuration.

Namespace:  System.Threading.Tasks
Assemblies:   mscorlib (in mscorlib.dll)
  System.Threading.Tasks (in System.Threading.Tasks.dll)

public TaskFactory(
	TaskCreationOptions creationOptions,
	TaskContinuationOptions continuationOptions
)

Parameters

creationOptions
Type: System.Threading.Tasks.TaskCreationOptions

The default options to use when creating tasks with this TaskFactory<TResult>.

continuationOptions
Type: System.Threading.Tasks.TaskContinuationOptions

The default options to use when creating continuation tasks with this TaskFactory<TResult>.

ExceptionCondition
ArgumentOutOfRangeException

creationOptions or continuationOptions specifies an invalid value.

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).

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft