ICallContextInitializer.BeforeInvoke 方法

定義

實作以參與作業執行緒的初始化。

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。 如果您想要建立某種自訂內容,這就是可以初始化靜態內容屬性的擴充點,這樣開發人員就可以在作業過程中使用這個內容屬性。

適用於