Create() public static method

Creates an instance of a configuration with reasonable default values.
public static Create ( ) : EndpointConfiguration
return EndpointConfiguration
コード例 #1
0
        /// <summary>
        /// Creates a binding for to use for discovering servers.
        /// </summary>
        public static DiscoveryClient Create(
            ApplicationConfiguration application,
            ITransportWaitingConnection connection,
            EndpointConfiguration configuration)
        {
            if (configuration == null)
            {
                configuration = EndpointConfiguration.Create();
            }

            ITransportChannel channel = DiscoveryChannel.Create(application, connection, configuration, application.CreateMessageContext());

            return(new DiscoveryClient(channel));
        }
コード例 #2
0
        /// <summary>
        /// Loads a collection of endpoints from a file and overrides the endpoint configuration.
        /// </summary>
        public static ConfiguredEndpointCollection Load(ApplicationConfiguration configuration, string filePath, bool overrideConfiguration)
        {
            ConfiguredEndpointCollection endpoints = Load(filePath);

            endpoints.m_defaultConfiguration = EndpointConfiguration.Create(configuration);

            // override the settings in the configuration.
            foreach (ConfiguredEndpoint endpoint in endpoints.Endpoints)
            {
                if (endpoint.Configuration == null || overrideConfiguration)
                {
                    endpoint.Update(endpoints.DefaultConfiguration);
                }
            }

            return(endpoints);
        }
コード例 #3
0
ファイル: DiscoveryClient.cs プロジェクト: benvert/pfe
        /// <summary>
        /// Creates a binding for to use for discovering servers.
        /// </summary>
        /// <param name="discoveryUrl">The discovery URL.</param>
        /// <param name="bindingFactory">The binding factory.</param>
        /// <param name="configuration">The configuration.</param>
        /// <returns></returns>
        public static DiscoveryClient Create(Uri discoveryUrl, BindingFactory bindingFactory, EndpointConfiguration configuration)
        {
            if (discoveryUrl == null)
            {
                throw new ArgumentNullException("discoveryUrl");
            }

            if (bindingFactory == null)
            {
                bindingFactory = BindingFactory.Default;
            }

            if (configuration == null)
            {
                configuration = EndpointConfiguration.Create();
            }

            ITransportChannel channel = DiscoveryChannel.Create(discoveryUrl, bindingFactory, configuration, new ServiceMessageContext());

            return(new DiscoveryClient(channel));
        }
コード例 #4
0
ファイル: DiscoveryClient.cs プロジェクト: benvert/pfe
 public static DiscoveryChannel Create(Uri discoveryUrl, string configurationName)
 {
     return(Create(discoveryUrl, EndpointConfiguration.Create(), BindingFactory.Default, configurationName));
 }