Table of Contents

Class SolverUtils

Namespace
ZeroInstall.Services.Solvers
Assembly
ZeroInstall.Services.dll

Helper functions for ISolver implementations.

public static class SolverUtils
Inheritance
SolverUtils
Inherited Members

Methods

AddCommand(ImplementationSelection, Requirements, Implementation)

Adds a Command specified in an Implementation to a ImplementationSelection.

public static Command? AddCommand(this ImplementationSelection selection, Requirements requirements, Implementation from)

Parameters

selection ImplementationSelection

The ImplementationSelection to add the Command to.

requirements Requirements

The requirements specifying which Command to extract.

from Implementation

The Implementation to get the Command from.

Returns

Command

The Command that was added to selection; null if none.

AddDependencies(IDependencyContainer, Requirements, IDependencyContainer)

Transfers Dependencys from one IDependencyContainer to another.

public static void AddDependencies(this IDependencyContainer target, Requirements requirements, IDependencyContainer from)

Parameters

target IDependencyContainer

The IDependencyContainer to add the Dependencys to.

requirements Requirements

The requirements which restrict which Dependencys are applicable.

from IDependencyContainer

The IDependencyContainer to get the Dependencys to.

AddRestriction(Requirements, Restriction)

Adds the version restriction from source to the requirements.

public static void AddRestriction(this Requirements requirements, Restriction source)

Parameters

requirements Requirements
source Restriction

AddRestrictions(Requirements, Requirements)

Adds the version restrictions from source to the requirements.

public static void AddRestrictions(this Requirements requirements, Requirements source)

Parameters

requirements Requirements
source Requirements

BucketizeImportance(IEnumerable<SolverDemand>)

Separates solver demands into buckets by importance.

public static (List<SolverDemand> essential, List<SolverDemand> recommended) BucketizeImportance(this IEnumerable<SolverDemand> demands)

Parameters

demands IEnumerable<SolverDemand>

Returns

(List<SolverDemand> essential, List<SolverDemand> recommended)

PurgeRestrictions(Selections)

Removes all Restrictions from Selections.

public static void PurgeRestrictions(this Selections selections)

Parameters

selections Selections

ToSelection(SelectionCandidate, Requirements, IReadOnlyList<SelectionCandidate>)

public static ImplementationSelection ToSelection(this SelectionCandidate candidate, Requirements requirements, IReadOnlyList<SelectionCandidate> allCandidates)

Parameters

candidate SelectionCandidate

The selection candidate.

requirements Requirements

The requirements the candidate was chosen for.

allCandidates IReadOnlyList<SelectionCandidate>

All candidates that were considered for selection (including candidate). These are used to present the user with possible alternatives.

Returns

ImplementationSelection

ToSelections(IEnumerable<SelectionCandidate>, SolverDemand)

[LinqTunnel]
public static IEnumerable<ImplementationSelection> ToSelections(this IEnumerable<SelectionCandidate> candidates, SolverDemand demand)

Parameters

candidates IEnumerable<SelectionCandidate>

The selection candidates.

demand SolverDemand

The solver demand the candidates were chosen for.

Returns

IEnumerable<ImplementationSelection>