Condividi tramite


Metodo TaskFactoryExtensions.FromAsync<TArg1, TArg2, TArg3, TArg4> (TaskFactory, Func<TArg1, TArg2, TArg3, TArg4, AsyncCallback, Object, IAsyncResult>, Action<IAsyncResult>, TArg1, TArg2, TArg3, TArg4, 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, TArg3, TArg4) ( _
    taskFactory As TaskFactory, _
    beginMethod As Func(Of TArg1, TArg2, TArg3, TArg4, AsyncCallback, Object, IAsyncResult), _
    endMethod As Action(Of IAsyncResult), _
    arg1 As TArg1, _
    arg2 As TArg2, _
    arg3 As TArg3, _
    arg4 As TArg4, _
    state As Object, _
    cancellationToken As CancellationToken, _
    creationOptions As TaskCreationOptions, _
    taskScheduler As TaskScheduler _
) As Task
public static Task FromAsync<TArg1, TArg2, TArg3, TArg4>(
    this TaskFactory taskFactory,
    Func<TArg1, TArg2, TArg3, TArg4, AsyncCallback, Object, IAsyncResult> beginMethod,
    Action<IAsyncResult> endMethod,
    TArg1 arg1,
    TArg2 arg2,
    TArg3 arg3,
    TArg4 arg4,
    Object state,
    CancellationToken cancellationToken,
    TaskCreationOptions creationOptions,
    TaskScheduler taskScheduler
)

Parametri di tipo

  • TArg1
  • TArg2
  • TArg3
  • TArg4

Parametri

  • arg1
    Tipo: TArg1
  • arg2
    Tipo: TArg2
  • arg3
    Tipo: TArg3
  • arg4
    Tipo: TArg4

Valore restituito

Tipo: System.Threading.Tasks.Task

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