Table of Contents

Class Selections

Namespace
ZeroInstall.Model.Selection
Assembly
ZeroInstall.Model.dll

Represents a set of ImplementationBases chosen by a solver.

[Serializable]
[Equatable]
public sealed class Selections : XmlUnknown, IEquatable<XmlUnknown>, IInterfaceUri, ICloneable<Selections>, IEquatable<Selections>
Inheritance
Selections
Implements
Inherited Members

Remarks

Properties

Command

The name of the Command in the interface to be started.

public string? Command { get; set; }

Property Value

string

Implementations

A list of ImplementationSelections chosen in this selection.

[UnorderedEquality]
public List<ImplementationSelection> Implementations { get; }

Property Value

List<ImplementationSelection>

InterfaceUri

The URI or local path of the interface this selection is based on.

public required FeedUri InterfaceUri { get; set; }

Property Value

FeedUri

this[FeedUri]

Returns the ImplementationSelection for a specific interface.

public ImplementationSelection this[FeedUri interfaceUri] { get; }

Parameters

interfaceUri FeedUri

The InterfaceUri to look for.

Property Value

ImplementationSelection

The first matching implementation.

Exceptions

KeyNotFoundException

No matching implementation was found.

MainImplementation

The main implementation in the selection (the actual program to launch). Identified by InterfaceUri.

public ImplementationSelection MainImplementation { get; }

Property Value

ImplementationSelection

Exceptions

KeyNotFoundException

No ImplementationSelection matching InterfaceUri was found in Implementations.

Name

The name specified by the feed at InterfaceUri.

public string? Name { get; set; }

Property Value

string

Source

Indicates whether the selection was generated for Source.

public bool Source { get; set; }

Property Value

bool

Methods

Clone()

Creates a deep copy of this Selections instance.

public Selections Clone()

Returns

Selections

The new copy of the Selections.

ContainsImplementation(FeedUri)

Determines whether an ImplementationSelection for a specific interface is listed in the selection.

public bool ContainsImplementation(FeedUri interfaceUri)

Parameters

interfaceUri FeedUri

The InterfaceUri to look for.

Returns

bool

true if an implementation was found; false otherwise.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetImplementation(FeedUri)

Returns the ImplementationSelection for a specific interface. Safe for missing elements.

public ImplementationSelection? GetImplementation(FeedUri interfaceUri)

Parameters

interfaceUri FeedUri

The InterfaceUri to look for.

Returns

ImplementationSelection

The first matching implementation; null if no matching one was found.

Normalize()

public void Normalize()

Exceptions

InvalidDataException

A required property is not set or invalid.

RestrictionsFor(FeedUri)

Gets a list of all Restrictions and Dependency that point to a specific interfaceUri.

public IEnumerable<Restriction> RestrictionsFor(FeedUri interfaceUri)

Parameters

interfaceUri FeedUri

Returns

IEnumerable<Restriction>

ToString()

Returns the selections as XML. Not safe for parsing!

public override string ToString()

Returns

string

Operators

operator ==(Selections?, Selections?)

Indicates whether the object on the left is equal to the object on the right.

public static bool operator ==(Selections? left, Selections? right)

Parameters

left Selections

The left object

right Selections

The right object

Returns

bool

true if the objects are equal; otherwise, false.

operator !=(Selections?, Selections?)

Indicates whether the object on the left is not equal to the object on the right.

public static bool operator !=(Selections? left, Selections? right)

Parameters

left Selections

The left object

right Selections

The right object

Returns

bool

true if the objects are not equal; otherwise, false.