public FileWatcherWrapper(FilePath path) { Path = path; watcher = new FSW.FileSystemWatcher(path) { // Need LastWrite otherwise no file change events are generated by the native file watcher. NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName, IncludeSubdirectories = true, InternalBufferSize = 32768 }; watcher.Changed += OnFileChanged; watcher.Deleted += OnFileDeleted; watcher.Renamed += OnFileRenamed; watcher.Error += OnFileWatcherError; }