EndpointDispatcher.DispatchRuntime 屬性

定義

取得 DispatchRuntime 物件,這個物件會用來檢查、修改或擴充整個服務端點或用戶端回呼端點中的執行階段行為。

public:
 property System::ServiceModel::Dispatcher::DispatchRuntime ^ DispatchRuntime { System::ServiceModel::Dispatcher::DispatchRuntime ^ get(); };
public System.ServiceModel.Dispatcher.DispatchRuntime DispatchRuntime { get; }
member this.DispatchRuntime : System.ServiceModel.Dispatcher.DispatchRuntime
Public ReadOnly Property DispatchRuntime As DispatchRuntime

屬性值

DispatchRuntime 物件,這個物件會用來檢查、修改或擴充整個服務端點或用戶端回呼端點中的執行階段行為。

範例

下列程式碼範例將示範使用 EndpointDispatcher 來找出端點的 System.ServiceModel.Dispatcher.DispatchRuntime,並使用端點行為來插入自訂訊息偵測器。

// IEndpointBehavior Members
public void AddBindingParameters(ServiceEndpoint serviceEndpoint, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
{
  return;
}

public void ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior)
{
  behavior.MessageInspectors.Add(new EndpointBehaviorMessageInspector());
}

public void ApplyDispatchBehavior(ServiceEndpoint serviceEndpoint, EndpointDispatcher endpointDispatcher)
{
  endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new EndpointBehaviorMessageInspector());
}

public void Validate(ServiceEndpoint serviceEndpoint)
{
  return;
}

備註

使用 DispatchRuntime 屬性,取得 DispatchRuntime 物件來修改執行階段值或為整個端點插入自訂執行階段擴充。 您也可以從 DispatchRuntime 屬性巡覽至端點的 System.ServiceModel.Dispatcher.DispatchOperation 集合。

適用於