System.Net.Configuration.WebRequestModulesSectionInternal.WebRequestModulesSectionInternal C# (CSharp) Method

WebRequestModulesSectionInternal() private method

private WebRequestModulesSectionInternal ( WebRequestModulesSection section ) : System.Configuration
section WebRequestModulesSection
return System.Configuration
        internal WebRequestModulesSectionInternal(WebRequestModulesSection section)
        {
            if (section.WebRequestModules.Count > 0)
            {
                this.webRequestModules = new ArrayList(section.WebRequestModules.Count);
                foreach(WebRequestModuleElement webRequestModuleElement in section.WebRequestModules)
                {
                    try
                    {
                        this.webRequestModules.Add(new WebRequestPrefixElement(webRequestModuleElement.Prefix, webRequestModuleElement.Type));
                    }
                    catch (Exception exception)
                    {
                        if (NclUtilities.IsFatal(exception)) throw;

                        throw new ConfigurationErrorsException(SR.GetString(SR.net_config_webrequestmodules), exception);
                    }
                    catch {
                        //
                        // throw exception for config debugging
                        //

                        throw new ConfigurationErrorsException(ConfigurationStrings.WebRequestModulesSectionPath, new Exception(SR.GetString(SR.net_nonClsCompliantException)));
                    }
                }
            }
        }
WebRequestModulesSectionInternal