/// <summary>
 /// Implements a modification or extension of the client across a contract.
 /// </summary>
 /// <param name="contractDescription">The contract description for which the extension is intended.</param>
 /// <param name="endpoint">The endpoint.</param>
 /// <param name="clientRuntime">The client runtime.</param>
 public void ApplyClientBehavior(
     ContractDescription contractDescription,
     ServiceEndpoint endpoint,
     ClientRuntime clientRuntime)
 {
     contractBehavior.ApplyClientBehavior(contractDescription, endpoint, clientRuntime);
 }
Exemplo n.º 2
0
        private static void ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime clientRuntime)
        {
            // contract behaviors
            ContractDescription contractDescription = serviceEndpoint.Contract;

            for (int i = 0; i < contractDescription.Behaviors.Count; i++)
            {
                IContractBehavior behavior = contractDescription.Behaviors[i];
                behavior.ApplyClientBehavior(contractDescription, serviceEndpoint, clientRuntime);
            }
            // endpoint behaviors
            BindingInformationEndpointBehavior.Instance.ApplyClientBehavior(serviceEndpoint, clientRuntime);
            for (int i = 0; i < serviceEndpoint.Behaviors.Count; i++)
            {
                IEndpointBehavior behavior = serviceEndpoint.Behaviors[i];
                behavior.ApplyClientBehavior(serviceEndpoint, clientRuntime);
            }
            // operation behaviors
            DispatcherBuilder.BindOperations(contractDescription, clientRuntime, null);
        }