private IEnumerable <Pair <FileInfo> > EnumerateCommonFilesLeftAndRight(DirectoryInfo leftFiles, DirectoryInfo rightFiles) { return(leftFiles.EnumerateFiles().Where(f => !ExcludedFileExtensions.Contains(f.Extension)).Where(f => rightFiles.HasFile(f)).Select(left => new Pair <FileInfo>(left, rightFiles.GetCorrespondingFile(left)))); }
public static bool ShouldExcludeExtension(string extension) { extension = extension.ToLowerInvariant(); return(ExcludedFileExtensions.Contains(extension)); }
private IEnumerable <FileInfo> EnumerateLeftFilesMissingRight(DirectoryInfo leftFiles, DirectoryInfo rightFiles) { return(leftFiles.EnumerateFiles().Where(f => !ExcludedFileExtensions.Contains(f.Extension)).Where(f => !rightFiles.HasFile(f))); }