private ICollection <string> FilesWithMechanismToImportToExistingComponent(ICollection <string> fileNames) { return(fileNames .Where(filename => Path.GetExtension(filename) != null && ComponentTypesForExtension.TryGetValue(Path.GetExtension(filename), out var componentTypes) && componentTypes.All(componentType => ComponentTypesWithImportMechanismToExistingComponent.Contains(componentType))) .ToHashSet()); }
protected bool HasMatchingFileExtension(string filename, QualifiedModuleName module) { var fileExtension = Path.GetExtension(filename); return(fileExtension != null && ComponentTypesForExtension.TryGetValue(fileExtension, out var componentTypes) && componentTypes.Contains(module.ComponentType)); }
private ICollection <string> DocumentFiles(Dictionary <string, string> moduleNames) { return(moduleNames .Select(kvp => kvp.Key) .Where(filename => Path.GetExtension(filename) != null && ComponentTypesForExtension.TryGetValue(Path.GetExtension(filename), out var componentTypes) && componentTypes.Contains(ComponentType.Document)) .ToHashSet()); }
private ICollection <string> RequiredBinaryFiles(string filename) { var extension = Path.GetExtension(filename); if (extension == null || !ComponentTypesForExtension.TryGetValue(extension, out var componentTypes)) { return(new List <string>()); } foreach (var componentType in componentTypes) { if (_binaryFileExtractors.TryGetValue(componentType, out var binaryExtractors)) { return(binaryExtractors .SelectMany(binaryExtractor => binaryExtractor .RequiredBinaryFiles(filename, componentType)) .ToHashSet()); } } return(new List <string>()); }