Metodo TaskFactoryExtensions.FromAsync<TArg1, TArg2, TResult> (TaskFactory, Func<TArg1, TArg2, AsyncCallback, Object, IAsyncResult>, Func<IAsyncResult, TResult>, TArg1, TArg2, Object, CancellationToken, TaskCreationOptions, TaskScheduler)

Spazio dei nomi: Microsoft.TeamFoundation.Threading
Assembly: Microsoft.TeamFoundation.Controls (in Microsoft.TeamFoundation.Controls.dll)

Sintassi

'Dichiarazione
<ExtensionAttribute> _
Public Shared Function FromAsync(Of TArg1, TArg2, TResult) ( _
    taskFactory As TaskFactory, _
    beginMethod As Func(Of TArg1, TArg2, AsyncCallback, Object, IAsyncResult), _
    endMethod As Func(Of IAsyncResult, TResult), _
    arg1 As TArg1, _
    arg2 As TArg2, _
    state As Object, _
    cancellationToken As CancellationToken, _
    creationOptions As TaskCreationOptions, _
    taskScheduler As TaskScheduler _
) As Task(Of TResult)
public static Task<TResult> FromAsync<TArg1, TArg2, TResult>(
    this TaskFactory taskFactory,
    Func<TArg1, TArg2, AsyncCallback, Object, IAsyncResult> beginMethod,
    Func<IAsyncResult, TResult> endMethod,
    TArg1 arg1,
    TArg2 arg2,
    Object state,
    CancellationToken cancellationToken,
    TaskCreationOptions creationOptions,
    TaskScheduler taskScheduler
)

Parametri di tipo

  • TArg1
  • TArg2
  • TResult

Parametri

  • arg1
    Tipo: TArg1
  • arg2
    Tipo: TArg2

Valore restituito

Tipo: System.Threading.Tasks.Task<TResult>

Nota sull'utilizzo

In Visual Basic e C# è possibile chiamare questo metodo come metodo di istanza su qualsiasi oggetto di tipo TaskFactory. Per chiamare il metodo utilizzando la sintassi del metodo di istanza, omettere il primo parametro. Per ulteriori informazioni, vedere Metodi di estensione (Visual Basic) o Metodi di estensione (Guida per programmatori C#).

Sicurezza di .NET Framework

Vedere anche

Riferimenti

TaskFactoryExtensions Classe

Overload FromAsync

Spazio dei nomi Microsoft.TeamFoundation.Threading