コード例 #1
0
 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());
 }
コード例 #2
0
        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));
        }
コード例 #3
0
 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());
 }
コード例 #4
0
        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>());
        }