Beispiel #1
0
        internal static WSStreamedHttpBindingCollectionElement GetCollectionElement()
        {
            WSStreamedHttpBindingCollectionElement retVal = null;
            BindingsSection bindingsSection = (BindingsSection)ConfigurationManager.GetSection("system.serviceModel/bindings");

            if (null != bindingsSection)
            {
                retVal = bindingsSection[WSStreamedHttpBindingConstants.WSStreamedHttpBindingCollectionElementName] as WSStreamedHttpBindingCollectionElement;
            }

            return(retVal);
        }
        void ApplyConfiguration(string configurationName)
        {
            WSStreamedHttpBindingCollectionElement    section = WSStreamedHttpBindingCollectionElement.GetCollectionElement();
            WSStreamedHttpBindingConfigurationElement element = section.Bindings[configurationName];

            if (element == null)
            {
                throw new ConfigurationErrorsException();
            }
            else
            {
                element.ApplyConfiguration(this);
            }
        }