Esempio n. 1
0
 /// <summary>
 /// Provides the ability to change run-time property values or insert custom extension objects such as error handlers, message or parameter interceptors, security extensions, and other custom extension objects.
 /// </summary>
 /// <param name="serviceDescription">The service description.</param><param name="serviceHostBase">The host that is currently being built.</param>
 public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
 {
     var handler = new GlobalErrorHandler();
     foreach (ChannelDispatcher dispatcher in serviceHostBase.ChannelDispatchers)
     {
         dispatcher.ErrorHandlers.Add(handler);
     }
 }
Esempio n. 2
0
        public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
        {
            IErrorHandler errorHandler = new GlobalErrorHandler();

            foreach (ChannelDispatcherBase channelDispatcherBase in serviceHostBase.ChannelDispatchers)
            {
                ChannelDispatcher channelDispatcher = channelDispatcherBase as ChannelDispatcher;

                if (channelDispatcher != null)
                {
                    channelDispatcher.ErrorHandlers.Add(errorHandler);
                }
            }
        }