private UriSectionInternal(UriSection section) : this() { this.idnScope = section.Idn.Enabled; this.iriParsing = section.IriParsing.Enabled; if (section.SchemeSettings != null) { foreach (SchemeSettingElement element in section.SchemeSettings) { SchemeSettingInternal internal2 = new SchemeSettingInternal(element.Name, element.GenericUriParserOptions); this.schemeSettings.Add(internal2.Name, internal2); } } }
private static UriSectionInternal LoadUsingSystemConfiguration() { try { UriSection section = System.Configuration.PrivilegedConfigurationManager.GetSection("uri") as UriSection; if (section == null) { return(null); } return(new UriSectionInternal(section)); } catch (ConfigurationException) { return(null); } }
private static UriSectionInternal LoadUsingSystemConfiguration() { try { UriSection section = PrivilegedConfigurationManager.GetSection( CommonConfigurationStrings.UriSectionName) as UriSection; if (section == null) { return(null); } return(new UriSectionInternal(section)); } catch (ConfigurationException) { // Simply ---- any ConfigurationException. // Throwing it would potentially break applications. // Uri did not read config in previous releases. return(null); } }