private static void OnDeleted(object sender, FileSystemEventArgs e, FileCache cache, FileCacheEntry entry) { var key = e.FullPath.Replace(entry._path, ""); 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, ""); var oldFile = e.OldFullPath; var newKey = e.FullPath.Replace(entry._path, ""); 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); }