private void scanning() { foreach (FileDescription file in this.files_to_scan) { if (!this.started) { break; } file.isVirus = VirusDetector.detect(file.path); file.isChecked = true; } }
private void on_changed(object source, FileSystemEventArgs e) { string path = e.FullPath; Thread.Sleep(3000); bool isFile = File.Exists(path); if (!isFile) { return; } if (!VirusDetector.detect(path)) { return; } if (!this.viruses.Contains(path)) { this.viruses.Add(path); } }