/////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// #if CACHE_PROVIDERS_IN_STATIC private static void InstantiateProviders() { if (_Providers != null) { return; } lock (_Lock) { if (_Providers != null) { return; } ProtectedConfigurationProviderCollection providers = new ProtectedConfigurationProviderCollection(); ProtectedConfigurationSection config = PrivilegedConfigurationManager.GetSection(BaseConfigurationRecord.RESERVED_SECTION_PROTECTED_CONFIGURATION) as ProtectedConfigurationSection; if (config != null) { foreach (DictionaryEntry de in config.ProviderNodes) { ProviderNode pn = de.Value as ProviderNode; if (pn == null) { continue; } providers.Add(pn.Provider); } } _Providers = providers; } }
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); } }