private static void OnFileChanged(string fullPath, WatcherChangeTypes changeType) { bool isDirectory = false; try { DirectoryInfo directoryInfo = new DirectoryInfo(fullPath); if (directoryInfo.Attributes == FileAttributes.Directory) { isDirectory = true; } } catch (UnauthorizedAccessException) { return; } string pathName; string fileName; FileWatcher.SplitePathAndFile(fullPath, out pathName, out fileName); FileDistributor.OnFileChanged(pathName, fileName, isDirectory, changeType); }
private static void OnFileRenamed(object source, RenamedEventArgs e) { FileWatcher.OnFileRenamed(e.OldFullPath, e.FullPath); }
private static void OnFileDeleted(object source, FileSystemEventArgs e) { FileWatcher.OnFileChanged(e.FullPath, e.ChangeType); }