コード例 #1
0
        /// <summary>
        /// Configure DataContractResolver.
        /// </summary>
        /// <param name="source">The source TChannel.</param>
        /// <param name="setDataContractResolverAction">A delegate to configure DataContractSerializerOperationBehavior.</param>
        public static void SetClientDataContractResolver(this object source, Action <DataContractSerializerOperationBehavior> setDataContractResolverAction)
        {
            IWcfClientBase wcfClient = source as IWcfClientBase;

            if (wcfClient != null)
            {
                wcfClient.SetDataContractResolverAction = setDataContractResolverAction;
            }
        }
コード例 #2
0
        /// <summary>
        /// Configure the client binding.
        /// </summary>
        /// <param name="source">The source TChannel.</param>
        /// <param name="setBindingAction">A delegate to configure Binding.</param>
        public static void SetClientBinding(this object source, Action <Binding> setBindingAction)
        {
            IWcfClientBase wcfClient = source as IWcfClientBase;

            if (wcfClient != null)
            {
                wcfClient.SetBindingAction = setBindingAction;
            }
        }
コード例 #3
0
        /// <summary>
        /// Configure the client credentials.
        /// </summary>
        /// <param name="source">The source TChannel.</param>
        /// <param name="setClientCredentialsAction">A delegate to configure ClientCredentials.</param>
        public static void SetClientCredentials(this object source, Action <ClientCredentials> setClientCredentialsAction)
        {
            IWcfClientBase wcfClient = source as IWcfClientBase;

            if (wcfClient != null)
            {
                wcfClient.SetClientCredentialsAction = setClientCredentialsAction;
            }
        }
コード例 #4
0
        /// <summary>
        /// Adds the endpoint behavior.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="endpointBehavior">The endpoint behavior.</param>
        /// <returns>The endpoint behavior to add.</returns>
        public static IEndpointBehavior AddEndpointBehavior(this IWcfClientBase source, IEndpointBehavior endpointBehavior)
        {
            source.Endpoint.Behaviors.Add(endpointBehavior);

            return(endpointBehavior);
        }