static void ConfigurationSaveHandler(_Configuration sender, ConfigurationSaveEventArgs args)
{
bool locked = false;
try {
#if SYSTEMCORE_DEP
sectionCacheLock.EnterWriteLock();
#endif
locked = true;
sectionCache.Clear();
} finally {
#if SYSTEMCORE_DEP
if (locked)
{
sectionCacheLock.ExitWriteLock();
}
#endif
}
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);
}
}
}
}
}
}