public void GenerateSrcMLFromDirectory(string directoryPath, string xmlFileName, IEnumerable<string> filesToExclude, Language languageFilter) {
if(!Directory.Exists(directoryPath)) {
throw new DirectoryNotFoundException(String.Format("{0} does not exist.", directoryPath));
}
var dir = new DirectoryInfo(directoryPath);
var fileObjectsToExclude = from f in filesToExclude
select new FileInfo(f);
var files = (from filePath in dir.GetFiles("*", SearchOption.AllDirectories)
where extensionMapping.ContainsKey(filePath.Extension)
select filePath).Except(fileObjectsToExclude, new FileInfoComparer());
IEnumerable<string> reducedFileList;
if(languageFilter == Language.Any) {
reducedFileList = from f in files
select f.FullName;
} else {
reducedFileList = from f in files
where extensionMapping.ContainsKey(f.Extension) && extensionMapping[f.Extension] == languageFilter
select f.FullName;
}
GenerateSrcMLFileFromFiles(reducedFileList, xmlFileName);
}