ClientBase<TChannel>.InvokeAsync(ClientBase<TChannel>.BeginOperationDelegate, Object[], ClientBase<TChannel>.EndOperationDelegate, SendOrPostCallback, Object) Método

Definición

Proporciona compatibilidad para implementar el modelo asincrónico basado en eventosProvides support for implementing the event-based asynchronous pattern. Para más información sobre este patrón, consulte Información general sobre el modelo asincrónico basado en eventos.For more information about this pattern, see Event-based Asynchronous Pattern Overview.

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)

Parámetros

beginOperationDelegate
ClientBase<TChannel>.BeginOperationDelegate

Un delegado que se utiliza para llamar a la operación asincrónica.A delegate that is used for calling the asynchronous operation.

inValues
Object[]

Los valores de entrada a la llamada asincrónica.The input values to the asynchronous call.

endOperationDelegate
ClientBase<TChannel>.EndOperationDelegate

Un delegado que se utiliza para finalizar la llamada asincrónica después de que se haya completado.A delegate that is used to end the asynchronous call after it has completed.

operationCompletedCallback
SendOrPostCallback

Una devolución de llamada proporcionada por el cliente que se invoca cuando el método asincrónico ha finalizado.A client-supplied callback that is invoked when the asynchronous method is complete. La devolución de llamada se pasa a ClientBase<TChannel>.BeginOperationDelegate.The callback is passed to the ClientBase<TChannel>.BeginOperationDelegate.

userState
Object

Objeto userState a asociar a la llamada asincrónica.The userState object to associate with the asynchronous call.

Comentarios

Proporcione un valor único, como un GUID o un código hash, en el parámetro userState para cada llamada a InvokeAsync(ClientBase<TChannel>.BeginOperationDelegate, Object[], ClientBase<TChannel>.EndOperationDelegate, SendOrPostCallback, Object) y, una vez finalizada cada operación, el controlador de eventos podrá determinar qué instancia de la operación generó el evento de finalización.Provide a unique value, such as a GUID or hash code, in the userState parameter for each call to InvokeAsync(ClientBase<TChannel>.BeginOperationDelegate, Object[], ClientBase<TChannel>.EndOperationDelegate, SendOrPostCallback, Object), and when each operation is completed, your event handler can determine which instance of the operation raised the completion event.

Se aplica a