static void ReenableWatcherOnConfigLocation (object state)
{
string path = state as string;
if (String.IsNullOrEmpty (path))
return;
DateTime lastWrite;
lock (saveLocationsCacheLock) {
if (!saveLocationsCache.TryGetValue (path, out lastWrite))
lastWrite = DateTime.MinValue;
}
DateTime now = DateTime.Now;
if (lastWrite == DateTime.MinValue || now.Subtract (lastWrite).TotalMilliseconds >= SAVE_LOCATIONS_CHECK_INTERVAL) {
saveLocationsTimer.Dispose ();
saveLocationsTimer = null;
HttpApplicationFactory.EnableWatcher (VirtualPathUtility.RemoveTrailingSlash (HttpRuntime.AppDomainAppPath), "?eb.?onfig");
} else
saveLocationsTimer.Change (SAVE_LOCATIONS_CHECK_INTERVAL, SAVE_LOCATIONS_CHECK_INTERVAL);
}