///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
#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;
}
}