TaskFactory Constructores

Definición

Inicializa una nueva instancia de la clase TaskFactory.Initializes a new instance of the TaskFactory class.

Sobrecargas

TaskFactory()

Inicializa una instancia de TaskFactory con la configuración predeterminada.Initializes a TaskFactory instance with the default configuration.

TaskFactory(CancellationToken)

Inicializa una instancia de TaskFactory con la configuración especificada.Initializes a TaskFactory instance with the specified configuration.

TaskFactory(TaskScheduler)

Inicializa una instancia de TaskFactory con la configuración especificada.Initializes a TaskFactory instance with the specified configuration.

TaskFactory(TaskCreationOptions, TaskContinuationOptions)

Inicializa una instancia de TaskFactory con la configuración especificada.Initializes a TaskFactory instance with the specified configuration.

TaskFactory(CancellationToken, TaskCreationOptions, TaskContinuationOptions, TaskScheduler)

Inicializa una instancia de TaskFactory con la configuración especificada.Initializes a TaskFactory instance with the specified configuration.

TaskFactory()

Inicializa una instancia de TaskFactory con la configuración predeterminada.Initializes a TaskFactory instance with the default configuration.

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

Comentarios

Este constructor crea una instancia de TaskFactory con una configuración predeterminada.This constructor creates a TaskFactory instance with a default configuration. La propiedad TaskCreationOptions se inicializa en None, la propiedad TaskContinuationOptions se inicializa en Noney la propiedad TaskScheduler se inicializa en el programador actual (vea Current).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).

Consulte también:

TaskFactory(CancellationToken)

Inicializa una instancia de TaskFactory con la configuración especificada.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

Parámetros

cancellationToken
CancellationToken

CancellationToken que se asignará a las tareas creadas por este TaskFactory a menos que se especifique explícitamente otro CancellationToken mientras se llama a los métodos del generador.The CancellationToken that will be assigned to tasks created by this TaskFactory unless another CancellationToken is explicitly specified while calling the factory methods.

Comentarios

Este constructor crea una instancia de TaskFactory con una configuración predeterminada.This constructor creates a TaskFactory instance with a default configuration. La propiedad TaskCreationOptions se inicializa en None, la propiedad TaskContinuationOptions se inicializa en Noney la propiedad TaskScheduler se inicializa en el programador actual (vea Current).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).

Consulte también:

TaskFactory(TaskScheduler)

Inicializa una instancia de TaskFactory con la configuración especificada.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)

Parámetros

scheduler
TaskScheduler

Objeto TaskScheduler predeterminado que se va a usar para programar las tareas creadas con TaskFactory.The TaskScheduler to use to schedule any tasks created with this TaskFactory. Un valor null indica que se debería emplear el objeto TaskScheduler actual.A null value indicates that the current TaskScheduler should be used.

Comentarios

Con este constructor, la propiedad TaskCreationOptions se inicializa en None, la propiedad TaskContinuationOptions se inicializa en Noney la propiedad TaskScheduler se inicializa en scheduler, a menos que sea NULL, en cuyo caso la propiedad se inicializa en el programador actual (vea Current).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).

Consulte también:

TaskFactory(TaskCreationOptions, TaskContinuationOptions)

Inicializa una instancia de TaskFactory con la configuración especificada.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)

Parámetros

creationOptions
TaskCreationOptions

Objeto TaskCreationOptions predeterminado que se va a usar al crear tareas con TaskFactory.The default TaskCreationOptions to use when creating tasks with this TaskFactory.

continuationOptions
TaskContinuationOptions

Objeto TaskContinuationOptions predeterminado que se va a usar al crear tareas de continuación con TaskFactory.The default TaskContinuationOptions to use when creating continuation tasks with this TaskFactory.

Excepciones

El argumento creationOptions especifica un valor TaskCreationOptions no válido.The creationOptions argument specifies an invalid TaskCreationOptions value. Para más información, vea los comentarios sobre FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions).For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions).

O bien,-or- El argumento continuationOptions especifica un valor no válido.The continuationOptions argument specifies an invalid value.

Comentarios

Con este constructor, la propiedad TaskCreationOptions se inicializa en creationOptions, la propiedad TaskContinuationOptions se inicializa en continuationOptionsy la propiedad TaskScheduler se inicializa en el programador actual (vea Current).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).

Consulte también:

TaskFactory(CancellationToken, TaskCreationOptions, TaskContinuationOptions, TaskScheduler)

Inicializa una instancia de TaskFactory con la configuración especificada.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

Parámetros

cancellationToken
CancellationToken

CancellationToken predeterminado que se asignará a las tareas creadas por este TaskFactory a menos que se especifique explícitamente otro CancellationToken mientras se llama a los métodos del generador.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

Objeto TaskCreationOptions predeterminado que se va a usar al crear tareas con TaskFactory.The default TaskCreationOptions to use when creating tasks with this TaskFactory.

continuationOptions
TaskContinuationOptions

Objeto TaskContinuationOptions predeterminado que se va a usar al crear tareas de continuación con TaskFactory.The default TaskContinuationOptions to use when creating continuation tasks with this TaskFactory.

scheduler
TaskScheduler

Objeto TaskScheduler predeterminado que se va a usar para programar las tareas creadas con TaskFactory.The default TaskScheduler to use to schedule any Tasks created with this TaskFactory. Un valor null indica que se debería emplear TaskScheduler.Current.A null value indicates that TaskScheduler.Current should be used.

Excepciones

El argumento creationOptions especifica un valor TaskCreationOptions no válido.The creationOptions argument specifies an invalid TaskCreationOptions value. Para más información, vea los comentarios sobre FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions).For more information, see the Remarks for FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Action<IAsyncResult>, Object, TaskCreationOptions).

O bien,-or- El argumento continuationOptions especifica un valor no válido.The continuationOptions argument specifies an invalid value.

Comentarios

Con este constructor, la propiedad TaskCreationOptions se inicializa en creationOptions, la propiedad TaskContinuationOptions se inicializa en continuationOptionsy la propiedad TaskScheduler se inicializa en scheduler, a menos que sea NULL, en cuyo caso la propiedad se inicializa en el programador actual (vea Current).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).

Consulte también:

Se aplica a