ZeroInstall.Services.Solvers.SelectionCandidateProvider.LookupOriginalImplementation C# (CSharp) Method

LookupOriginalImplementation() public method

Retrieves the original Implementation an ImplementationSelection was based ofF.
public LookupOriginalImplementation ( ImplementationSelection implemenationSelection ) : Implementation
implemenationSelection ImplementationSelection
return Implementation
        public Implementation LookupOriginalImplementation(ImplementationSelection implemenationSelection)
        {
            #region Sanity checks
            if (implemenationSelection == null) throw new ArgumentNullException(nameof(implemenationSelection));
            #endregion

            return implemenationSelection.ID.StartsWith(ExternalImplementation.PackagePrefix)
                ? _externalImplementations[implemenationSelection.ID]
                : _feedManager[implemenationSelection.FromFeed ?? implemenationSelection.InterfaceUri][implemenationSelection.ID];
        }
    }

Usage Example

Example #1
0
            private bool TryToUseExistingCandidate([NotNull] Requirements requirements, [NotNull, ItemNotNull] IEnumerable <SelectionCandidate> suitableCandidates, [NotNull] ImplementationSelection selection)
            {
                if (!suitableCandidates.Contains(selection))
                {
                    return(false);
                }
                if (selection.ContainsCommand(requirements.Command))
                {
                    return(true);
                }

                var command = selection.AddCommand(requirements, from: _candidateProvider.LookupOriginalImplementation(selection));

                return(TryToSolveCommand(command, requirements));
            }
All Usage Examples Of ZeroInstall.Services.Solvers.SelectionCandidateProvider::LookupOriginalImplementation