共用方式為


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 或雜湊程式碼等唯一值,當每個作業完成時,事件處理常式就可以判斷哪一個作業執行個體引發了完成事件。

適用於