ClientBase<TChannel>.InvokeAsync Metod

Definition

Ger stöd för att implementera det händelsebaserade asynkrona mönstret. Mer information om det här mönstret finns i Händelsebaserad asynkron mönsteröversikt.

protected:
 void InvokeAsync(System::ServiceModel::ClientBase<TChannel>::BeginOperationDelegate ^ beginOperationDelegate, cli::array <System::Object ^> ^ inValues, System::ServiceModel::ClientBase<TChannel>::EndOperationDelegate ^ endOperationDelegate, System::Threading::SendOrPostCallback ^ operationCompletedCallback, System::Object ^ userState);
protected void InvokeAsync(System.ServiceModel.ClientBase<TChannel>.BeginOperationDelegate beginOperationDelegate, object[] inValues, System.ServiceModel.ClientBase<TChannel>.EndOperationDelegate endOperationDelegate, System.Threading.SendOrPostCallback operationCompletedCallback, object userState);
member this.InvokeAsync : System.ServiceModel.ClientBase<'Channel (requires 'Channel : null)>.BeginOperationDelegate * obj[] * System.ServiceModel.ClientBase<'Channel (requires 'Channel : null)>.EndOperationDelegate * System.Threading.SendOrPostCallback * obj -> unit
Protected Sub InvokeAsync (beginOperationDelegate As ClientBase(Of TChannel).BeginOperationDelegate, inValues As Object(), endOperationDelegate As ClientBase(Of TChannel).EndOperationDelegate, operationCompletedCallback As SendOrPostCallback, userState As Object)

Parametrar

beginOperationDelegate
ClientBase<TChannel>.BeginOperationDelegate

Ett ombud som används för att anropa den asynkrona åtgärden.

inValues
Object[]

Indatavärdena till det asynkrona anropet.

endOperationDelegate
ClientBase<TChannel>.EndOperationDelegate

Ett ombud som används för att avsluta det asynkrona anropet när det har slutförts.

operationCompletedCallback
SendOrPostCallback

Ett återanrop från klienten som anropas när den asynkrona metoden är klar. Återanropet skickas till ClientBase<TChannel>.BeginOperationDelegate.

userState
Object

Objektet userState som ska associeras med det asynkrona anropet.

Kommentarer

Ange ett unikt värde, till exempel ett GUID eller hash-kod, i parametern userState för varje anrop till InvokeAsync(ClientBase<TChannel>.BeginOperationDelegate, Object[], ClientBase<TChannel>.EndOperationDelegate, SendOrPostCallback, Object), och när varje åtgärd har slutförts kan händelsehanteraren avgöra vilken instans av åtgärden som genererade slutförandehändelsen.

Gäller för