public void RemoveFileByExtensions(string root, string[] extensions) { MatchByFileExtensionEvaluator evaluator = new MatchByFileExtensionEvaluator(extensions); RemoveFilesByCustomEvaluator(root, evaluator); }
public void CopyFullToFlat(string sourceFolder, string targetFolder, string[] fileExtensions) { _directory.CreateFolder(targetFolder); MatchEvaluators.MatchByFileExtensionEvaluator evaluator = new MatchByFileExtensionEvaluator(fileExtensions); foreach (string file in _directoryViewer.Files) { if (evaluator.IsMatch(file)) { bool cancel = false; FileInfo fileInfo = new FileInfo(file); HandleFileSystemAcion(() => _directory.CopyFile(file, targetFolder + "\\" + fileInfo.Name), file, "Error occured while copying file " + file, "Copied file " + file, out cancel ); if(cancel) break; } } }