Exemple #1
0
        private IEnumerable <CommandCandidate> GetCommandCandidates(
            string commandName,
            DependencyContext dependencyContext,
            CommandCandidateType commandCandidateType)
        {
            var commandCandidates = new List <CommandCandidate>();

            foreach (var runtimeLibrary in dependencyContext.RuntimeLibraries)
            {
                IEnumerable <RuntimeAssetGroup> runtimeAssetGroups = null;

                if (commandCandidateType == CommandCandidateType.NativeCommandCandidate)
                {
                    runtimeAssetGroups = runtimeLibrary.NativeLibraryGroups;
                }
                else if (commandCandidateType == CommandCandidateType.RuntimeCommandCandidate)
                {
                    runtimeAssetGroups = runtimeLibrary.RuntimeAssemblyGroups;
                }

                commandCandidates.AddRange(GetCommandCandidatesFromRuntimeAssetGroups(
                                               commandName,
                                               runtimeAssetGroups,
                                               runtimeLibrary.Name,
                                               runtimeLibrary.Version));
            }

            return(commandCandidates);
        }
        private IEnumerable<CommandCandidate> GetCommandCandidates(
            string commandName, 
            DependencyContext dependencyContext,
            CommandCandidateType commandCandidateType)
        {
            var commandCandidates = new List<CommandCandidate>();

            foreach (var runtimeLibrary in dependencyContext.RuntimeLibraries)
            {
                IEnumerable<RuntimeAssetGroup> runtimeAssetGroups = null;

                if (commandCandidateType == CommandCandidateType.NativeCommandCandidate)
                {
                    runtimeAssetGroups = runtimeLibrary.NativeLibraryGroups;
                }
                else if (commandCandidateType == CommandCandidateType.RuntimeCommandCandidate)
                {
                    runtimeAssetGroups = runtimeLibrary.RuntimeAssemblyGroups;
                }

                commandCandidates.AddRange(GetCommandCandidatesFromRuntimeAssetGroups(
                                    commandName,
                                    runtimeAssetGroups,
                                    runtimeLibrary.Name,
                                    runtimeLibrary.Version));            
            }

            return commandCandidates;
        }