示例#1
0
        public FileSystemWatcher CreateFileSystemWatchers(string filters)
        {
            var monitoredPath = MonitoredPath();

            try
            {
                var fileSystemWatcher = new System.IO.FileSystemWatcher
                {
                    Path                  = monitoredPath,
                    NotifyFilter          = DefaultNotifyFilters(),
                    Filter                = "*.*",
                    IncludeSubdirectories = true,
                };
                return(new WindowsFileSystemWatcher(fileSystemWatcher, monitoredPath, filters));
            }
            catch (ArgumentException e)
            {
                throw new CouldNotMonitorSpecifiedPathException(monitoredPath, e);
            }
        }
 public WindowsFileSystemWatcher(System.IO.FileSystemWatcher watcher, string monitoredPath, string monitoredFilters)
 {
     _watcher          = watcher;
     _monitoredPath    = monitoredPath;
     _monitoredFilters = monitoredFilters;
 }