private void CheckFiles(object sender, FileSystemEventArgs e) { int i = 0; var dir = new DirectoryInfo(_targetDirectory); foreach (FileInfo file in dir.GetFiles()) { if (_fileList.Contains(file.Name)) { i++; } } if (i == _fileList.Count) { Unsubscribe(); DocumentsReady?.Invoke(); } }
private void Stop() { DocumentsReady?.Invoke(); Unsubscribe(); }