コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public DefaultFileSystemWatch(IFileSystemWatchWrapperFactory watchWrapperFactory, string path, bool recursive = false, string filter = null)
 {
     watch = watchWrapperFactory.CreateWatch(path, recursive, filter);
     watch.AddListener(this);
 }