ChannelDispatcher.ChannelInitializers プロパティ

定義

チャネルが最初に作成されるときに状態を検査してチャネルに状態を追加するために使用できる IChannelInitializer オブジェクトのセットを取得します。

public:
 property System::Collections::Generic::SynchronizedCollection<System::ServiceModel::Dispatcher::IChannelInitializer ^> ^ ChannelInitializers { System::Collections::Generic::SynchronizedCollection<System::ServiceModel::Dispatcher::IChannelInitializer ^> ^ get(); };
public System.Collections.Generic.SynchronizedCollection<System.ServiceModel.Dispatcher.IChannelInitializer> ChannelInitializers { get; }
member this.ChannelInitializers : System.Collections.Generic.SynchronizedCollection<System.ServiceModel.Dispatcher.IChannelInitializer>
Public ReadOnly Property ChannelInitializers As SynchronizedCollection(Of IChannelInitializer)

プロパティ値

SynchronizedCollection<IChannelInitializer>

SynchronizedCollection<T> 型オブジェクトの IChannelInitializer

Uri baseAddress = new Uri("http://localhost:8001/Simple");
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

serviceHost.AddServiceEndpoint(
    typeof(ICalculator),
    new WSHttpBinding(),
    "CalculatorServiceObject");

serviceHost.Open();

ChannelDispatcher dispatcher = (ChannelDispatcher) serviceHost.ChannelDispatchers[0];
SynchronizedCollection<IChannelInitializer> col = dispatcher.ChannelInitializers;
Dim baseAddress As New Uri("http://localhost:8001/Simple")
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

serviceHost.AddServiceEndpoint(GetType(ICalculator), New WSHttpBinding(), "CalculatorServiceObject")

serviceHost.Open()

Dim dispatcher As ChannelDispatcher = CType(serviceHost.ChannelDispatchers(0), ChannelDispatcher)
Dim col As SynchronizedCollection(Of IChannelInitializer) = dispatcher.ChannelInitializers

注釈

このプロパティを使用して、チャネルの作成時にチャネルの状態を検査または変更するため、カスタムのチャネル初期化子を初期化コレクションに挿入します。 チャネル初期化子は、ディスパッチャーに関連付けられたコントラクトが双方向コントラクトであるとき、送信チャネルの状態を検査または変更する際にも有用です。

適用対象