ClientBase<TChannel>.InvokeAsync 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供實作基於事件的非同步模式的支援。 欲了解更多此模式資訊,請參閱 事件基礎非同步模式概述。
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的參數中提供唯一值,例如 GUID 或雜湊碼,InvokeAsync(ClientBase<TChannel>.BeginOperationDelegate, Object[], ClientBase<TChannel>.EndOperationDelegate, SendOrPostCallback, Object)當每個操作完成後,你的事件處理器就能判斷是哪個操作實例引發了完成事件。