Пример #1
0
        public static RouterBindingCollectionElement GetBindingCollectionElement()
        {
            RouterBindingCollectionElement retval = null;

            BindingsSection bindingsSection = (BindingsSection)ConfigurationManager.GetSection("system.serviceModel/bindings");

            if (null != bindingsSection)
            {
                retval = bindingsSection["routerBinding"] as RouterBindingCollectionElement;
            }

            return(retval);
        }
Пример #2
0
        void ApplyConfiguration(string configurationName)
        {
            RouterBindingCollectionElement bindingCollectionElement = RouterBindingCollectionElement.GetBindingCollectionElement();
            RouterBindingElement           element = bindingCollectionElement.Bindings[configurationName];

            if (element == null)
            {
                throw new ConfigurationErrorsException(string.Format("ConfigInvalidBindingConfigurationName", configurationName, bindingCollectionElement.BindingName));
            }
            else
            {
                element.ApplyConfiguration(this);
            }
        }