static void RunScan(IFileSystemElement fileSystemElement, ISystemScanner scanner) { var result = scanner.Scan(fileSystemElement); Console.WriteLine($"{scanner.GetType()} Result:"); foreach (var suspect in result) { Console.WriteLine($"'{suspect.Name}' in '{suspect.Path}'"); } if (!result.Any()) { Console.WriteLine("Вирусов нет"); } Console.WriteLine(); }
/// <summary> /// Метод для двойной диспетчеризации файлов /// </summary> /// <see cref="ISystemScanner"/> public IList <Suspect> Accept(ISystemScanner scanner) { return(scanner.Scan(this)); }