ChannelDispatcher.ChannelInitializers ChannelDispatcher.ChannelInitializers ChannelDispatcher.ChannelInitializers ChannelDispatcher.ChannelInitializers Property

Définition

Obtient un ensemble d'objets IChannelInitializer que vous pouvez utiliser pour inspecter et ajouter l'état aux canaux lors de leur création.Gets a set of IChannelInitializer objects that you can use to inspect and add state to channels when they are first created.

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)

Valeur de propriété

Exemples

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

Remarques

Utilisez cette propriété pour insérer un initialiseur de canal personnalisé dans la collection d’initialisation pour inspecter ou modifier l’état des canaux lors de leur création.Use this property to insert a custom channel initializer into the initialization collection to inspect or modify channel state when they are created. Cette propriété est également utile pour exécuter le même comportement sur les canaux sortants si le contrat associé à un répartiteur est un contrat duplex.This is also useful to perform the same behavior on outgoing channels if the contract associated with a dispatcher is a duplex contract.

S’applique à