Поделиться через


Task.Factory Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Provides access to factory methods for creating Task and Task<TResult> instances.

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

Syntax

'Declaration
Public Shared ReadOnly Property Factory As TaskFactory
public static TaskFactory Factory { get; }

Property Value

Type: System.Threading.Tasks.TaskFactory
The default TaskFactory for the current task.

Remarks

The factory returned from Factory is a default instance of TaskFactory, as would result from using the default constructor on TaskFactory. The most common use of this property is to create a new task and start it in one call to StartNew. For an example, see How to: Return a Value from a Task.

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.