ChannelDispatcher.ErrorHandlers Propriété

Définition

Obtient un ensemble d'objets IErrorHandler qui peuvent être utilisés pour insérer les fonctionnalités de gestion des erreurs personnalisées pour un point de terminaison.

public:
 property System::Collections::ObjectModel::Collection<System::ServiceModel::Dispatcher::IErrorHandler ^> ^ ErrorHandlers { System::Collections::ObjectModel::Collection<System::ServiceModel::Dispatcher::IErrorHandler ^> ^ get(); };
public System.Collections.ObjectModel.Collection<System.ServiceModel.Dispatcher.IErrorHandler> ErrorHandlers { get; }
member this.ErrorHandlers : System.Collections.ObjectModel.Collection<System.ServiceModel.Dispatcher.IErrorHandler>
Public ReadOnly Property ErrorHandlers As Collection(Of IErrorHandler)

Valeur de propriété

Collection<IErrorHandler>

SynchronizedCollection<T> d'objets IErrorHandler.

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];
Collection<IErrorHandler> col = dispatcher.ErrorHandlers;
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 Collection(Of IErrorHandler) = dispatcher.ErrorHandlers

S’applique à