public FileSystemEventProducer(IFileSizeEstimator fileSizeEstimator, string path, int internalBufferSize = 32768) { _fileSizeEstimator = fileSizeEstimator ?? throw new ArgumentNullException(nameof(fileSizeEstimator)); _path = path ?? throw new ArgumentNullException(nameof(path)); _rootId = new FileSystemEntryId(path); _fileSystemWatcher = new FileSystemWatcher(path) { IncludeSubdirectories = true, NotifyFilter = NotifyFilters.DirectoryName | NotifyFilters.FileName | NotifyFilters.Size, SynchronizingObject = new SynchronizingObject(_fswEventBuffer), InternalBufferSize = internalBufferSize }; _fileSystemWatcher.Created += OnCreated; _fileSystemWatcher.Changed += OnChanged; _fileSystemWatcher.Renamed += OnRenamed; _fileSystemWatcher.Deleted += OnDeleted; _fileSystemWatcher.Error += OnError; }
public FileSystemIndexer(IFileSizeEstimator fileSizeEstimator) { _fileSizeEstimator = fileSizeEstimator; }