/// <summary> /// Fires the OnFileSystemChanged event. Since the internal /// FileSystemWatcher buffer for change notifications is very limited, /// and it only freed when the change event is processed, report the /// change to our consumers on another thread, to ensure that the /// FileSystemWatcher receives control of this thread back as soon /// as possible. /// </summary> /// <param name="e"></param> private void OnFileSystemChanged(FileSystemChangeEventArgs e) { //TODO: Use another thread if (FileSystemChanged != null) { FileSystemChanged(this, e); } }
private void _monitor_FileSystemChanged(object sender, FileSystemChangeEventArgs e) { _fsChangedFired = true; _fsChangedFireCount++; _lastChangeType = e.ChangeType; _lastNewPath = e.NewPath; _lastOldPath = e.OldPath; }