ClientBase<TChannel>.InvokeAsync 方法

定义

为实现基于事件的异步模式提供支持。 有关详细信息,请参阅基于事件的异步模式概述

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)

参数

beginOperationDelegate
ClientBase<TChannel>.BeginOperationDelegate

一个用于调用异步操作的委托。

inValues
Object[]

异步调用的输入值。

endOperationDelegate
ClientBase<TChannel>.EndOperationDelegate

一个用于在异步调用完成后将其结束的委托。

operationCompletedCallback
SendOrPostCallback

一个在异步方法完成时调用的由客户端提供的回调。 系统会将该回调传递给 ClientBase<TChannel>.BeginOperationDelegate

userState
Object

要与异步调用关联的 userState 对象。

注解

userState 参数中,为各个 InvokeAsync(ClientBase<TChannel>.BeginOperationDelegate, Object[], ClientBase<TChannel>.EndOperationDelegate, SendOrPostCallback, Object) 调用提供一个唯一值(如 GUID 或哈希代码),这样,当各个操作完成时,你的事件处理程序便可以确定是哪个操作的实例引发了完成事件。

适用于