Example #1
0
        public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
        {
            IParameterInspector timer = new CallTimer(endpoint.Contract.Name, true);

            foreach (ClientOperation op in clientRuntime.Operations)
            {
                op.ParameterInspectors.Add(timer);
            }
        }
 public void ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase)
 {
     foreach (var channelDispatcherBase in serviceHostBase.ChannelDispatchers)
     {
         var chanDisp = (ChannelDispatcher)channelDispatcherBase;
         foreach (EndpointDispatcher epDisp in chanDisp.Endpoints)
         {
             var timer = new CallTimer(epDisp.ContractName, false);
             foreach (DispatchOperation op in epDisp.DispatchRuntime.Operations)
             {
                 op.ParameterInspectors.Add(timer);
             }
         }
     }
 }