コード例 #1
0
 public void ConfigureEndpoint(Uri uri, Action <IEndpointConfigurator> action)
 {
     try
     {
         _endpointConfigurators.Store(uri, action);
     }
     catch (Exception ex)
     {
         throw new ConfigurationException("The endpoint could not be configured: " + uri, ex);
     }
 }
コード例 #2
0
        private void ConnectTransportConfigurators(IEnumerable <Type> transportTypes)
        {
            const BindingFlags bindingFlags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

            foreach (Type transportType in transportTypes)
            {
                MethodInfo mi = GetConfigureEndpointMethodInfo(transportType, bindingFlags);

                Func <Uri, Action <IEndpointConfigurator>, IEndpoint> invoker = BuildConfigureEndpointLambda(mi);

                _transportConfigurators.Store(transportType, invoker);
            }
        }