static void ConfigurationSaveHandler (_Configuration sender, ConfigurationSaveEventArgs args)
{
try {
sectionCacheLock.EnterWriteLock ();
sectionCache.Clear ();
} finally {
sectionCacheLock.ExitWriteLock ();
}
lock (suppressAppReloadLock) {
string rootConfigPath = WebConfigurationHost.GetWebConfigFileName (HttpRuntime.AppDomainAppPath);
if (String.Compare (args.StreamPath, rootConfigPath, StringComparison.OrdinalIgnoreCase) == 0) {
SuppressAppReload (args.Start);
if (args.Start) {
HttpApplicationFactory.DisableWatcher (VirtualPathUtility.RemoveTrailingSlash (HttpRuntime.AppDomainAppPath), "?eb.?onfig");
lock (saveLocationsCacheLock) {
if (saveLocationsCache == null)
saveLocationsCache = new Dictionary <string, DateTime> (StringComparer.Ordinal);
if (saveLocationsCache.ContainsKey (rootConfigPath))
saveLocationsCache [rootConfigPath] = DateTime.Now;
else
saveLocationsCache.Add (rootConfigPath, DateTime.Now);
if (saveLocationsTimer == null)
saveLocationsTimer = new Timer (ReenableWatcherOnConfigLocation,
rootConfigPath,
SAVE_LOCATIONS_CHECK_INTERVAL,
SAVE_LOCATIONS_CHECK_INTERVAL);
}
}
}
}
}