Zero Install .NET API 2.20.0
ZeroInstall.Services.Solvers.SolverUtils Class Reference

Helper functions for ISolver implementations. More...

Static Public Member Functions

static IEnumerable< ImplementationSelectionToSelections (this IEnumerable< SelectionCandidate > candidates, SolverDemand demand)
 Turns SelectionCandidates into ImplementationSelections. More...
 
static ImplementationSelection ToSelection (this SelectionCandidate candidate, Requirements requirements, [InstantHandle] IEnumerable< SelectionCandidate > allCandidates)
 Turns a SelectionCandidate into a ImplementationSelection. More...
 
static void AddDependencies (this IDependencyContainer target, Requirements requirements, IDependencyContainer from)
 Transfers Dependencys from one IDependencyContainer to another. More...
 
static ? Command AddCommand (this ImplementationSelection selection, Requirements requirements, Implementation from)
 Adds a Command specified in an Implementation to a ImplementationSelection. More...
 
static void AddRestriction (this Requirements requirements, Restriction source)
 Adds the version restriction from source to the requirements .
 
static void AddRestrictions (this Requirements requirements, Requirements source)
 Adds the version restrictions from source to the requirements .
 
static void PurgeRestrictions (this Selections selections)
 Removes all Restrictions from Selections.
 

Detailed Description

Helper functions for ISolver implementations.

Member Function Documentation

◆ AddCommand()

static ? Command ZeroInstall.Services.Solvers.SolverUtils.AddCommand ( this ImplementationSelection  selection,
Requirements  requirements,
Implementation  from 
)
inlinestatic

Adds a Command specified in an Implementation to a ImplementationSelection.

Parameters
selectionThe ImplementationSelection to add the Command to.
requirementsThe requirements specifying which Requirements.Command to extract.
fromThe Implementation to get the Command from.
Returns
The Command that was added to selection ; null if none.

◆ AddDependencies()

static void ZeroInstall.Services.Solvers.SolverUtils.AddDependencies ( this IDependencyContainer  target,
Requirements  requirements,
IDependencyContainer  from 
)
inlinestatic

Transfers Dependencys from one IDependencyContainer to another.

Parameters
targetThe IDependencyContainer to add the Dependencys to.
requirementsThe requirements which restrict which Dependencys are applicable.
fromThe IDependencyContainer to get the Dependencys to.

◆ ToSelection()

static ImplementationSelection ZeroInstall.Services.Solvers.SolverUtils.ToSelection ( this SelectionCandidate  candidate,
Requirements  requirements,
[InstantHandle] IEnumerable< SelectionCandidate allCandidates 
)
inlinestatic

Turns a SelectionCandidate into a ImplementationSelection.

Parameters
candidateThe selection candidate.
requirementsThe requirements the candidate was chosen for.
allCandidatesAll candidates that were considered for selection (including candidate ). These are used to present the user with possible alternatives.

◆ ToSelections()

static IEnumerable< ImplementationSelection > ZeroInstall.Services.Solvers.SolverUtils.ToSelections ( this IEnumerable< SelectionCandidate candidates,
SolverDemand  demand 
)
static

Turns SelectionCandidates into ImplementationSelections.

Parameters
candidatesThe selection candidates.
demandThe solver demand the candidates were chosen for.

The documentation for this class was generated from the following file: