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); }
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); } }