TaskFactory<TResult>.FromAsync TaskFactory<TResult>.FromAsync TaskFactory<TResult>.FromAsync TaskFactory<TResult>.FromAsync Method

Definición

Crea una nueva instancia de tarea.Creates a task instance.

Sobrecargas

FromAsync(IAsyncResult, Func<IAsyncResult,TResult>) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>)

Crea una tarea que ejecuta una función del método End cuando se completa la interfaz IAsyncResult especificada.Creates a task that executes an end method function when a specified IAsyncResult completes.

FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions)

Crea una tarea que ejecuta una función del método End cuando se completa la interfaz IAsyncResult especificada.Creates a task that executes an end method function when a specified IAsyncResult completes.

FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object, TaskCreationOptions) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object, TaskCreationOptions) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object, TaskCreationOptions) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object, TaskCreationOptions)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions, TaskScheduler) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions, TaskScheduler) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions, TaskScheduler) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions, TaskScheduler)

Crea una tarea que ejecuta una función del método End cuando se completa la interfaz IAsyncResult especificada.Creates a task that executes an end method function when a specified IAsyncResult completes.

FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object, TaskCreationOptions) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object, TaskCreationOptions) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object, TaskCreationOptions) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object, TaskCreationOptions)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object, TaskCreationOptions) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object, TaskCreationOptions) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object, TaskCreationOptions) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object, TaskCreationOptions)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

FromAsync(IAsyncResult, Func<IAsyncResult,TResult>) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>)

Crea una tarea que ejecuta una función del método End cuando se completa la interfaz IAsyncResult especificada.Creates a task that executes an end method function when a specified IAsyncResult completes.

public:
 System::Threading::Tasks::Task<TResult> ^ FromAsync(IAsyncResult ^ asyncResult, Func<IAsyncResult ^, TResult> ^ endMethod);
public System.Threading.Tasks.Task<TResult> FromAsync (IAsyncResult asyncResult, Func<IAsyncResult,TResult> endMethod);
member this.FromAsync : IAsyncResult * Func<IAsyncResult, 'Result> -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync (asyncResult As IAsyncResult, endMethod As Func(Of IAsyncResult, TResult)) As Task(Of TResult)

Parámetros

asyncResult
IAsyncResult IAsyncResult IAsyncResult IAsyncResult

El objeto IAsyncResult que al completarse debería desencadenar el procesamiento del objeto endMethod.The IAsyncResult whose completion should trigger the processing of the endMethod.

endMethod
Func<IAsyncResult,TResult>

Delegado de función que procesa el objeto asyncResult completado.The function delegate that processes the completed asyncResult.

Devoluciones

Objeto Task<TResult> que representa la operación asincrónica.A Task<TResult> that represents the asynchronous operation.

Excepciones

El argumento asyncResult es null.The asyncResult argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

Consulte también:

FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

public:
 System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, System::Object ^ state);
public System.Threading.Tasks.Task<TResult> FromAsync (Func<AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, object state);
member this.FromAsync : Func<AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * obj -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync (beginMethod As Func(Of AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), state As Object) As Task(Of TResult)

Parámetros

beginMethod
Func<AsyncCallback,Object,IAsyncResult>

Delegado que comienza la operación asincrónica.The delegate that begins the asynchronous operation.

endMethod
Func<IAsyncResult,TResult>

Delegado que finaliza la operación asincrónica.The delegate that ends the asynchronous operation.

state
Object Object Object Object

Objeto que contiene los datos que el delegado de beginMethod va a usar.An object containing data to be used by the beginMethod delegate.

Devoluciones

Tarea creada que representa la operación asincrónica.The created task that represents the asynchronous operation.

Excepciones

El argumento beginMethod es null.The beginMethod argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

Comentarios

Este método produce cualquier excepción producida por el beginMethod.This method throws any exceptions thrown by the beginMethod. Excepciones para endmethod se produce cuando se espera en la tarea devuelta.Exceptions for endmethod are thrown when waiting on the returned task.

Consulte también:

FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions)

Crea una tarea que ejecuta una función del método End cuando se completa la interfaz IAsyncResult especificada.Creates a task that executes an end method function when a specified IAsyncResult completes.

public:
 System::Threading::Tasks::Task<TResult> ^ FromAsync(IAsyncResult ^ asyncResult, Func<IAsyncResult ^, TResult> ^ endMethod, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync (IAsyncResult asyncResult, Func<IAsyncResult,TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : IAsyncResult * Func<IAsyncResult, 'Result> * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync (asyncResult As IAsyncResult, endMethod As Func(Of IAsyncResult, TResult), creationOptions As TaskCreationOptions) As Task(Of TResult)

Parámetros

asyncResult
IAsyncResult IAsyncResult IAsyncResult IAsyncResult

El objeto IAsyncResult que al completarse debería desencadenar el procesamiento del objeto endMethod.The IAsyncResult whose completion should trigger the processing of the endMethod.

endMethod
Func<IAsyncResult,TResult>

Delegado de función que procesa el objeto asyncResult completado.The function delegate that processes the completed asyncResult.

creationOptions
TaskCreationOptions TaskCreationOptions TaskCreationOptions TaskCreationOptions

Uno de los valores de enumeración que controla el comportamiento de la tarea creada.One of the enumeration values that controls the behavior of the created task.

Devoluciones

Tarea que representa la operación asincrónica.A task that represents the asynchronous operation.

Excepciones

El argumento asyncResult es null.The asyncResult argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

El argumento creationOptions especifica un valor no válido.The creationOptions argument specifies an invalid value.

Consulte también:

FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object, TaskCreationOptions) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object, TaskCreationOptions) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object, TaskCreationOptions) FromAsync(Func<AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, Object, TaskCreationOptions)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

public:
 System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync (Func<AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync (beginMethod As Func(Of AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), state As Object, creationOptions As TaskCreationOptions) As Task(Of TResult)

Parámetros

beginMethod
Func<AsyncCallback,Object,IAsyncResult>

Delegado que comienza la operación asincrónica.The delegate that begins the asynchronous operation.

endMethod
Func<IAsyncResult,TResult>

Delegado que finaliza la operación asincrónica.The delegate that ends the asynchronous operation.

state
Object Object Object Object

Objeto que contiene los datos que el delegado de beginMethod va a usar.An object containing data to be used by the beginMethod delegate.

creationOptions
TaskCreationOptions TaskCreationOptions TaskCreationOptions TaskCreationOptions

Uno de los valores de enumeración que controla el comportamiento de la tarea creada.One of the enumeration values that controls the behavior of the created task.

Devoluciones

Objeto Task<TResult> creado que representa la operación asincrónica.The created Task<TResult> that represents the asynchronous operation.

Excepciones

El argumento beginMethod es null.The beginMethod argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

El argumento creationOptions especifica un valor no válido.The creationOptions argument specifies an invalid value.

Comentarios

Este método produce cualquier excepción producida por el beginMethod.This method throws any exceptions thrown by the beginMethod. Excepciones para endmethod se produce cuando se espera en la tarea devuelta.Exceptions for endmethod are thrown when waiting on the returned task.

Consulte también:

FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions, TaskScheduler) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions, TaskScheduler) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions, TaskScheduler) FromAsync(IAsyncResult, Func<IAsyncResult,TResult>, TaskCreationOptions, TaskScheduler)

Crea una tarea que ejecuta una función del método End cuando se completa la interfaz IAsyncResult especificada.Creates a task that executes an end method function when a specified IAsyncResult completes.

public:
 System::Threading::Tasks::Task<TResult> ^ FromAsync(IAsyncResult ^ asyncResult, Func<IAsyncResult ^, TResult> ^ endMethod, System::Threading::Tasks::TaskCreationOptions creationOptions, System::Threading::Tasks::TaskScheduler ^ scheduler);
public System.Threading.Tasks.Task<TResult> FromAsync (IAsyncResult asyncResult, Func<IAsyncResult,TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler);
member this.FromAsync : IAsyncResult * Func<IAsyncResult, 'Result> * System.Threading.Tasks.TaskCreationOptions * System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync (asyncResult As IAsyncResult, endMethod As Func(Of IAsyncResult, TResult), creationOptions As TaskCreationOptions, scheduler As TaskScheduler) As Task(Of TResult)

Parámetros

asyncResult
IAsyncResult IAsyncResult IAsyncResult IAsyncResult

El objeto IAsyncResult que al completarse debería desencadenar el procesamiento del objeto endMethod.The IAsyncResult whose completion should trigger the processing of the endMethod.

endMethod
Func<IAsyncResult,TResult>

Delegado de función que procesa el objeto asyncResult completado.The function delegate that processes the completed asyncResult.

creationOptions
TaskCreationOptions TaskCreationOptions TaskCreationOptions TaskCreationOptions

Uno de los valores de enumeración que controla el comportamiento de la tarea creada.One of the enumeration values that controls the behavior of the created task.

scheduler
TaskScheduler TaskScheduler TaskScheduler TaskScheduler

El programador de tareas que se usa para programar la tarea que ejecuta el método End.The task scheduler that is used to schedule the task that executes the end method.

Devoluciones

Tarea creada que representa la operación asincrónica.The created task that represents the asynchronous operation.

Excepciones

El argumento asyncResult es null.The asyncResult argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

O bien-or- El argumento scheduler es null.The scheduler argument is null.

El parámetro creationOptions especifica un valor no válido.The creationOptions parameter specifies an invalid value.

Consulte también:

FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object, TaskCreationOptions)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

public:
generic <typename TArg1, typename TArg2, typename TArg3>
 System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, TArg2, TArg3, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2,TArg3> (Func<TArg1,TArg2,TArg3,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<'TArg1, 'TArg2, 'TArg3, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * 'TArg2 * 'TArg3 * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1, TArg2, TArg3) (beginMethod As Func(Of TArg1, TArg2, TArg3, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, arg2 As TArg2, arg3 As TArg3, state As Object, creationOptions As TaskCreationOptions) As Task(Of TResult)

Parámetros de tipo

TArg1

Tipo del segundo argumento que se pasa al delegado de beginMethod.The type of the second argument passed to beginMethod delegate.

TArg2

Tipo del tercer argumento que se pasa al delegado de beginMethod.The type of the third argument passed to beginMethod delegate.

TArg3

Tipo del primer argumento que se pasa al delegado de beginMethod.The type of the first argument passed to the beginMethod delegate.

Parámetros

beginMethod
Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>

Delegado que comienza la operación asincrónica.The delegate that begins the asynchronous operation.

endMethod
Func<IAsyncResult,TResult>

Delegado que finaliza la operación asincrónica.The delegate that ends the asynchronous operation.

arg1

Primer argumento que se pasa al delegado de beginMethod.The first argument passed to the beginMethod delegate.

arg2

Segundo argumento que se pasa al delegado de beginMethod.The second argument passed to the beginMethod delegate.

arg3

Tercer argumento que se pasa al delegado de beginMethod.The third argument passed to the beginMethod delegate.

state
Object Object Object Object

Objeto que contiene los datos que el delegado de beginMethod va a usar.An object containing data to be used by the beginMethod delegate.

creationOptions
TaskCreationOptions TaskCreationOptions TaskCreationOptions TaskCreationOptions

Un objeto que controla el comportamiento de la tarea creada.An object that controls the behavior of the created task.

Devoluciones

Tarea creada que representa la operación asincrónica.The created task that represents the asynchronous operation.

Excepciones

El argumento beginMethod es null.The beginMethod argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

El parámetro creationOptions especifica un valor no válido.The creationOptions parameter specifies an invalid value.

Comentarios

Este método produce cualquier excepción producida por el beginMethod.This method throws any exceptions thrown by the beginMethod. Excepciones para endmethod se produce cuando se espera en la tarea devuelta.Exceptions for endmethod are thrown when waiting on the returned task.

Consulte también:

FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object) FromAsync<TArg1,TArg2,TArg3>(Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, TArg3, Object)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

public:
generic <typename TArg1, typename TArg2, typename TArg3>
 System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, TArg2, TArg3, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, System::Object ^ state);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2,TArg3> (Func<TArg1,TArg2,TArg3,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object state);
member this.FromAsync : Func<'TArg1, 'TArg2, 'TArg3, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * 'TArg2 * 'TArg3 * obj -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1, TArg2, TArg3) (beginMethod As Func(Of TArg1, TArg2, TArg3, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, arg2 As TArg2, arg3 As TArg3, state As Object) As Task(Of TResult)

Parámetros de tipo

TArg1

Tipo del segundo argumento que se pasa al delegado de beginMethod.The type of the second argument passed to beginMethod delegate.

TArg2

Tipo del tercer argumento que se pasa al delegado de beginMethod.The type of the third argument passed to beginMethod delegate.

TArg3

Tipo del primer argumento que se pasa al delegado de beginMethod.The type of the first argument passed to the beginMethod delegate.

Parámetros

beginMethod
Func<TArg1,TArg2,TArg3,AsyncCallback,Object,IAsyncResult>

Delegado que comienza la operación asincrónica.The delegate that begins the asynchronous operation.

endMethod
Func<IAsyncResult,TResult>

Delegado que finaliza la operación asincrónica.The delegate that ends the asynchronous operation.

arg1

Primer argumento que se pasa al delegado de beginMethod.The first argument passed to the beginMethod delegate.

arg2

Segundo argumento que se pasa al delegado de beginMethod.The second argument passed to the beginMethod delegate.

arg3

Tercer argumento que se pasa al delegado de beginMethod.The third argument passed to the beginMethod delegate.

state
Object Object Object Object

Objeto que contiene los datos que el delegado de beginMethod va a usar.An object containing data to be used by the beginMethod delegate.

Devoluciones

Tarea creada que representa la operación asincrónica.The created task that represents the asynchronous operation.

Excepciones

El argumento beginMethod es null.The beginMethod argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

Comentarios

Este método produce cualquier excepción producida por el beginMethod.This method throws any exceptions thrown by the beginMethod. Excepciones para endmethod se produce cuando se espera en la tarea devuelta.Exceptions for endmethod are thrown when waiting on the returned task.

Consulte también:

FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object, TaskCreationOptions) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object, TaskCreationOptions) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object, TaskCreationOptions) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object, TaskCreationOptions)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

public:
generic <typename TArg1, typename TArg2>
 System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, TArg2, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, TArg2 arg2, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2> (Func<TArg1,TArg2,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<'TArg1, 'TArg2, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * 'TArg2 * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1, TArg2) (beginMethod As Func(Of TArg1, TArg2, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, arg2 As TArg2, state As Object, creationOptions As TaskCreationOptions) As Task(Of TResult)

Parámetros de tipo

TArg1

Tipo del segundo argumento que se pasa al delegado de beginMethod.The type of the second argument passed to beginMethod delegate.

TArg2

Tipo del primer argumento que se pasa al delegado de beginMethod.The type of the first argument passed to the beginMethod delegate.

Parámetros

beginMethod
Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>

Delegado que comienza la operación asincrónica.The delegate that begins the asynchronous operation.

endMethod
Func<IAsyncResult,TResult>

Delegado que finaliza la operación asincrónica.The delegate that ends the asynchronous operation.

arg1

Primer argumento que se pasa al delegado de beginMethod.The first argument passed to the beginMethod delegate.

arg2

Segundo argumento que se pasa al delegado de beginMethod.The second argument passed to the beginMethod delegate.

state
Object Object Object Object

Objeto que contiene los datos que el delegado de beginMethod va a usar.An object containing data to be used by the beginMethod delegate.

creationOptions
TaskCreationOptions TaskCreationOptions TaskCreationOptions TaskCreationOptions

Un objeto que controla el comportamiento del objeto Task<TResult>creado.An object that controls the behavior of the created Task<TResult>.

Devoluciones

Tarea creada que representa la operación asincrónica.The created task that represents the asynchronous operation.

Excepciones

El argumento beginMethod es null.The beginMethod argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

El parámetro creationOptions especifica un valor no válido.The creationOptions parameter specifies an invalid value.

Comentarios

Este método produce cualquier excepción producida por el beginMethod.This method throws any exceptions thrown by the beginMethod. Excepciones para endmethod se produce cuando se espera en la tarea devuelta.Exceptions for endmethod are thrown when waiting on the returned task.

Consulte también:

FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object) FromAsync<TArg1,TArg2>(Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, TArg2, Object)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

public:
generic <typename TArg1, typename TArg2>
 System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, TArg2, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, TArg2 arg2, System::Object ^ state);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1,TArg2> (Func<TArg1,TArg2,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, TArg2 arg2, object state);
member this.FromAsync : Func<'TArg1, 'TArg2, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * 'TArg2 * obj -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1, TArg2) (beginMethod As Func(Of TArg1, TArg2, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, arg2 As TArg2, state As Object) As Task(Of TResult)

Parámetros de tipo

TArg1

Tipo del segundo argumento que se pasa al delegado de beginMethod.The type of the second argument passed to beginMethod delegate.

TArg2

Tipo del primer argumento que se pasa al delegado de beginMethod.The type of the first argument passed to the beginMethod delegate.

Parámetros

beginMethod
Func<TArg1,TArg2,AsyncCallback,Object,IAsyncResult>

Delegado que comienza la operación asincrónica.The delegate that begins the asynchronous operation.

endMethod
Func<IAsyncResult,TResult>

Delegado que finaliza la operación asincrónica.The delegate that ends the asynchronous operation.

arg1

Primer argumento que se pasa al delegado de beginMethod.The first argument passed to the beginMethod delegate.

arg2

Segundo argumento que se pasa al delegado de beginMethod.The second argument passed to the beginMethod delegate.

state
Object Object Object Object

Objeto que contiene los datos que el delegado de beginMethod va a usar.An object containing data to be used by the beginMethod delegate.

Devoluciones

Tarea creada que representa la operación asincrónica.The created task that represents the asynchronous operation.

Excepciones

El argumento beginMethod es null.The beginMethod argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

Comentarios

Este método produce cualquier excepción producida por el beginMethod.This method throws any exceptions thrown by the beginMethod. Excepciones para endmethod se produce cuando se espera en la tarea devuelta.Exceptions for endmethod are thrown when waiting on the returned task.

Consulte también:

FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

public:
generic <typename TArg1>
 System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, System::Object ^ state);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1> (Func<TArg1,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, object state);
member this.FromAsync : Func<'TArg1, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * obj -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1) (beginMethod As Func(Of TArg1, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, state As Object) As Task(Of TResult)

Parámetros de tipo

TArg1

Tipo del primer argumento que se pasa al delegado de beginMethod.The type of the first argument passed to the beginMethod delegate.

Parámetros

beginMethod
Func<TArg1,AsyncCallback,Object,IAsyncResult>

Delegado que comienza la operación asincrónica.The delegate that begins the asynchronous operation.

endMethod
Func<IAsyncResult,TResult>

Delegado que finaliza la operación asincrónica.The delegate that ends the asynchronous operation.

arg1

Primer argumento que se pasa al delegado de beginMethod.The first argument passed to the beginMethod delegate.

state
Object Object Object Object

Objeto que contiene los datos que el delegado de beginMethod va a usar.An object containing data to be used by the beginMethod delegate.

Devoluciones

Tarea creada que representa la operación asincrónica.The created task that represents the asynchronous operation.

Excepciones

El argumento beginMethod es null.The beginMethod argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

Comentarios

Este método produce cualquier excepción producida por el beginMethod.This method throws any exceptions thrown by the beginMethod. Excepciones para endmethod se produce cuando se espera en la tarea devuelta.Exceptions for endmethod are thrown when waiting on the returned task.

Consulte también:

FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object, TaskCreationOptions) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object, TaskCreationOptions) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object, TaskCreationOptions) FromAsync<TArg1>(Func<TArg1,AsyncCallback,Object,IAsyncResult>, Func<IAsyncResult,TResult>, TArg1, Object, TaskCreationOptions)

Crea una tarea que representa un par de métodos Begin y End que se ajustan al modelo de programación asincrónica.Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern.

public:
generic <typename TArg1>
 System::Threading::Tasks::Task<TResult> ^ FromAsync(Func<TArg1, AsyncCallback ^, System::Object ^, IAsyncResult ^> ^ beginMethod, Func<IAsyncResult ^, TResult> ^ endMethod, TArg1 arg1, System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1> (Func<TArg1,AsyncCallback,object,IAsyncResult> beginMethod, Func<IAsyncResult,TResult> endMethod, TArg1 arg1, object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
member this.FromAsync : Func<'TArg1, AsyncCallback, obj, IAsyncResult> * Func<IAsyncResult, 'Result> * 'TArg1 * obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.Task<'Result>
Public Function FromAsync(Of TArg1) (beginMethod As Func(Of TArg1, AsyncCallback, Object, IAsyncResult), endMethod As Func(Of IAsyncResult, TResult), arg1 As TArg1, state As Object, creationOptions As TaskCreationOptions) As Task(Of TResult)

Parámetros de tipo

TArg1

Tipo del primer argumento que se pasa al delegado de beginMethod.The type of the first argument passed to the beginMethod delegate.

Parámetros

beginMethod
Func<TArg1,AsyncCallback,Object,IAsyncResult>

Delegado que comienza la operación asincrónica.The delegate that begins the asynchronous operation.

endMethod
Func<IAsyncResult,TResult>

Delegado que finaliza la operación asincrónica.The delegate that ends the asynchronous operation.

arg1

Primer argumento que se pasa al delegado de beginMethod.The first argument passed to the beginMethod delegate.

state
Object Object Object Object

Objeto que contiene los datos que el delegado de beginMethod va a usar.An object containing data to be used by the beginMethod delegate.

creationOptions
TaskCreationOptions TaskCreationOptions TaskCreationOptions TaskCreationOptions

Uno de los valores de enumeración que controla el comportamiento de la tarea creada.One of the enumeration values that controls the behavior of the created task.

Devoluciones

Tarea creada que representa la operación asincrónica.The created task that represents the asynchronous operation.

Excepciones

El argumento beginMethod es null.The beginMethod argument is null.

O bien-or- El argumento endMethod es null.The endMethod argument is null.

El parámetro creationOptions especifica un valor no válido.The creationOptions parameter specifies an invalid value.

Comentarios

Este método produce cualquier excepción producida por el beginMethod.This method throws any exceptions thrown by the beginMethod. Excepciones para endmethod se produce cuando se espera en la tarea devuelta.Exceptions for endmethod are thrown when waiting on the returned task.

Consulte también:

Se aplica a