public override void OnCreate(object sender, FileSystemEventArgs e) { base.OnCreate(sender, e); if (!recursive) { return; } if (!fileSystem.ExistingPathIsDirectory(e.FullPath)) { return; } Logger.Debug("Added Child Directory: {0}", e.FullPath); lock (lk) { var childWatch = watchWrapperFactory.CreateWatch(e.FullPath, false, watch.Filter); watches.Add(e.FullPath, childWatch); childWatch.AddListener(this); } }
public AdaptiveFileSystemWatch(IFileSystemWatchWrapperFactory watchWrapperFactory, IFileSystem fileSystem, string path, bool recursive = false, string filter = null) { this.watchWrapperFactory = watchWrapperFactory; this.fileSystem = fileSystem; this.recursive = recursive; watch = watchWrapperFactory.CreateWatch(path, false, filter); watch.AddListener(this); if (recursive) { ScanChildPaths(path); } }
public DefaultFileSystemWatch(IFileSystemWatchWrapperFactory watchWrapperFactory, string path, bool recursive = false, string filter = null) { watch = watchWrapperFactory.CreateWatch(path, recursive, filter); watch.AddListener(this); }