ICallContextInitializer.BeforeInvoke 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
實作以參與操作執行緒的初始化。
public:
System::Object ^ BeforeInvoke(System::ServiceModel::InstanceContext ^ instanceContext, System::ServiceModel::IClientChannel ^ channel, System::ServiceModel::Channels::Message ^ message);
public object BeforeInvoke(System.ServiceModel.InstanceContext instanceContext, System.ServiceModel.IClientChannel channel, System.ServiceModel.Channels.Message message);
abstract member BeforeInvoke : System.ServiceModel.InstanceContext * System.ServiceModel.IClientChannel * System.ServiceModel.Channels.Message -> obj
Public Function BeforeInvoke (instanceContext As InstanceContext, channel As IClientChannel, message As Message) As Object
參數
- instanceContext
- InstanceContext
該操作的服務實例。
- channel
- IClientChannel
客戶端頻道。
- message
- Message
收到的訊息。
傳回
一個關聯物件作為 AfterInvoke(Object) 方法的參數回傳。
備註
實作 BeforeInvoke 初始化並清理呼叫使用者程式碼執行緒的執行緒本地儲存的方法。 典型用法是設定某個值,例如模擬或改變 System.Globalization.CultureInfo。 如果你想建立一些自訂上下文,這是初始化靜態上下文屬性的擴充點,然後開發者在操作過程中可以使用這個屬性。