internal static RequestCachingSectionInternal GetSection() { RequestCachingSectionInternal internal2; lock (ClassSyncObject) { RequestCachingSection section = System.Configuration.PrivilegedConfigurationManager.GetSection(ConfigurationStrings.RequestCachingSectionPath) as RequestCachingSection; if (section == null) { internal2 = null; } else { try { internal2 = new RequestCachingSectionInternal(section); } catch (Exception exception) { if (NclUtilities.IsFatal(exception)) { throw; } throw new ConfigurationErrorsException(System.SR.GetString("net_config_requestcaching"), exception); } } } return internal2; }
private static void LoadConfigSettings() { lock (s_BypassCacheBinding) { if (s_CacheConfigSettings == null) { RequestCachingSectionInternal section = RequestCachingSectionInternal.GetSection(); s_DefaultGlobalBinding = new RequestCacheBinding(section.DefaultCache, section.DefaultHttpValidator, section.DefaultCachePolicy); s_DefaultHttpBinding = new RequestCacheBinding(section.DefaultCache, section.DefaultHttpValidator, section.DefaultHttpCachePolicy); s_DefaultFtpBinding = new RequestCacheBinding(section.DefaultCache, section.DefaultFtpValidator, section.DefaultFtpCachePolicy); s_CacheConfigSettings = section; } } }
// private static void LoadConfigSettings() { // Any concurent access shall go here and block until we've grabbed the config settings lock (s_BypassCacheBinding) { if (s_CacheConfigSettings == null) { RequestCachingSectionInternal settings = RequestCachingSectionInternal.GetSection(); s_DefaultGlobalBinding = new RequestCacheBinding (settings.DefaultCache, settings.DefaultHttpValidator, settings.DefaultCachePolicy); s_DefaultHttpBinding = new RequestCacheBinding (settings.DefaultCache, settings.DefaultHttpValidator, settings.DefaultHttpCachePolicy); s_DefaultFtpBinding = new RequestCacheBinding (settings.DefaultCache, settings.DefaultFtpValidator, settings.DefaultFtpCachePolicy); s_CacheConfigSettings = settings; } } }