示例#1
0
        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);
        }
示例#2
0
 private static void OnFileRenamed(object source, RenamedEventArgs e)
 {
     FileWatcher.OnFileRenamed(e.OldFullPath, e.FullPath);
 }
示例#3
0
 private static void OnFileDeleted(object source, FileSystemEventArgs e)
 {
     FileWatcher.OnFileChanged(e.FullPath, e.ChangeType);
 }