private static void OnDeleted(object sender, FileSystemEventArgs e, FileCache cache, FileCacheEntry entry) { var key = e.FullPath.Replace(entry._path, entry._prefix); var file = e.FullPath; cache.RemoveFileInternal(entry._path, key); }
private static void OnRenamed(object sender, RenamedEventArgs e, FileCache cache, FileCacheEntry entry) { var oldKey = e.OldFullPath.Replace(entry._path, entry._prefix); var oldFile = e.OldFullPath; var newKey = e.FullPath.Replace(entry._path, entry._prefix); var newFile = e.FullPath; // Skip missing files if (!File.Exists(newFile)) { return; } // Skip directory updates if (IsDirectory(newFile)) { return; } cache.RemoveFileInternal(entry._path, oldKey); cache.InsertFileInternal(entry._path, newFile, newKey, entry._timespan, entry._handler); }