private static void OnChanged(object S, FileSystemEventArgs E) { FileWatchHandle H = Watch(E.FullPath); if (H != null) { H.HasChanged = true; } }
private static void OnChanged(object S, FileSystemEventArgs E) { //GConsole.WriteLine("File changed: {0}", E.FullPath); FileWatchHandle H = Watch(E.FullPath); if (H != null) { H.HasChanged = true; } }
public static FileWatchHandle Watch(string FullPath, bool FetchOnly = false) { FullPath = Path.GetFullPath(FullPath).NormalizeFilePath(); if (WatchedFiles.ContainsKey(FullPath)) { return(WatchedFiles[FullPath]); } if (FetchOnly) { return(null); } FileWatchHandle H = new FileWatchHandle(); H.FullFilePath = FullPath; WatchedFiles.Add(FullPath, H); return(H); }