Beispiel #1
0
 static string GetName(IFilePath filePath)
 {
     try
     {
         return(filePath.GetFileName());
     }
     catch
     {
         return(filePath.GetDirectoryName());
     }
 }
Beispiel #2
0
        public void WatchTriggerResource(IFileSystemWatcher watcher)
        {
            var path     = _filePath.GetDirectoryName(_path);
            var filename = _filePath.GetFileName(_path);

            watcher.EnableRaisingEvents = false;

            watcher.Path         = path;
            watcher.Filter       = filename;
            watcher.NotifyFilter = NotifyFilters.LastWrite
                                   | NotifyFilters.FileName
                                   | NotifyFilters.DirectoryName;

            watcher.EnableRaisingEvents = true;
        }