Exemplo n.º 1
0
        private static void OnChanged(object S, FileSystemEventArgs E)
        {
            FileWatchHandle H = Watch(E.FullPath);

            if (H != null)
            {
                H.HasChanged = true;
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        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);
        }