daily pastebin goal
87%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 54 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1.     public class ServiceBehaviorEvents : IServiceBehavior
  2.     {
  3.         public event Action<ServiceDescription, ServiceHostBase> ApplyDispatchBehavior;
  4.         public event Action<ServiceDescription, ServiceHostBase, Collection<ServiceEndpoint>, BindingParameterCollection> AddBindingParameters;
  5.         public event Action<ServiceDescription, ServiceHostBase> Validate;
  6.  
  7.         public static ServiceBehaviorEvents Install(ServiceHostBase host)
  8.         {
  9.             var evt = new ServiceBehaviorEvents();
  10.             host.Description.Behaviors.Add(evt);
  11.             return evt;
  12.         }
  13.  
  14.         void IServiceBehavior.AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase, Collection<ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
  15.         {
  16.             var evt = this.AddBindingParameters;
  17.             if (evt != null)
  18.             {
  19.                 evt(serviceDescription, serviceHostBase, endpoints, bindingParameters);
  20.             }
  21.         }
  22.  
  23.         void IServiceBehavior.ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
  24.         {
  25.             var evt = this.ApplyDispatchBehavior;
  26.             if (evt != null)
  27.             {
  28.                 evt(serviceDescription, serviceHostBase);
  29.             }
  30.         }
  31.  
  32.         void IServiceBehavior.Validate(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
  33.         {
  34.             var evt = this.Validate;
  35.             if (evt != null)
  36.             {
  37.                 evt(serviceDescription, serviceHostBase);
  38.             }
  39.         }
  40.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top