Show / Hide Table of Contents

Class Selections

Represents a set of ImplementationBases chosen by a solver.

Inheritance
Object
XmlUnknown
Selections
Implements
IEquatable<XmlUnknown>
IInterfaceUri
ICloneable<Selections>
IEquatable<Selections>
Inherited Members
XmlUnknown.UnknownAttributes
XmlUnknown.UnknownElements
XmlUnknown.EnsureAttribute(Object, String)
XmlUnknown.EnsureAttributeSafeID(String, String)
XmlUnknown.ToShortXml()
XmlUnknown.Equals(XmlUnknown)
Namespace: ZeroInstall.Model.Selection
Assembly: ZeroInstall.Model.dll
Syntax
public sealed class Selections : XmlUnknown, IInterfaceUri
Remarks

See also: https://docs.0install.net/specifications/selections/

Constructors

Selections()

Declaration
public Selections()

Properties

Command

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

Declaration
public string Command { get; set; }
Property Value
Type Description
String

Implementations

A list of ImplementationSelections chosen in this selection.

Declaration
public List<ImplementationSelection> Implementations { get; }
Property Value
Type Description
List<ImplementationSelection>

InterfaceUri

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

Declaration
public FeedUri InterfaceUri { get; set; }
Property Value
Type Description
FeedUri

InterfaceUriString

Used for XML serialization.

Declaration
public string InterfaceUriString { get; set; }
Property Value
Type Description
String
See Also
InterfaceUri

Item[FeedUri]

Returns the ImplementationSelection for a specific interface.

Declaration
public ImplementationSelection this[FeedUri interfaceUri] { get; }
Parameters
Type Name Description
FeedUri interfaceUri

The InterfaceUri to look for.

Property Value
Type Description
ImplementationSelection

The first matching implementation.

Exceptions
Type Condition
KeyNotFoundException

No matching implementation was found.

MainImplementation

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

Declaration
public ImplementationSelection MainImplementation { get; }
Property Value
Type Description
ImplementationSelection
Exceptions
Type Condition
KeyNotFoundException

No ImplementationSelection matching InterfaceUri was found in Implementations.

Name

The name specified by the feed at InterfaceUri.

Declaration
public string Name { get; set; }
Property Value
Type Description
String

Source

Indicates whether the selection was generated for Source.

Declaration
public bool Source { get; set; }
Property Value
Type Description
Boolean

Methods

Clone()

Creates a deep copy of this Selections instance.

Declaration
public Selections Clone()
Returns
Type Description
Selections

The new copy of the Selections.

ContainsImplementation(FeedUri)

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

Declaration
public bool ContainsImplementation(FeedUri interfaceUri)
Parameters
Type Name Description
FeedUri interfaceUri

The InterfaceUri to look for.

Returns
Type Description
Boolean

true if an implementation was found; false otherwise.

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
Boolean

Equals(Selections)

Declaration
public bool Equals(Selections other)
Parameters
Type Name Description
Selections other
Returns
Type Description
Boolean

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32
Overrides
XmlUnknown.GetHashCode()

GetImplementation(FeedUri)

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

Declaration
public ImplementationSelection GetImplementation(FeedUri interfaceUri)
Parameters
Type Name Description
FeedUri interfaceUri

The InterfaceUri to look for.

Returns
Type Description
ImplementationSelection

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

Normalize()

Calls Normalize(FeedUri) for all Implementations.

Declaration
public void Normalize()
Exceptions
Type Condition
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.

Declaration
public IEnumerable<Restriction> RestrictionsFor(FeedUri interfaceUri)
Parameters
Type Name Description
FeedUri interfaceUri
Returns
Type Description
IEnumerable<Restriction>

ToString()

Returns the selections as XML. Not safe for parsing!

Declaration
public override string ToString()
Returns
Type Description
String

Operators

Equality(Selections, Selections)

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

Declaration
public static bool operator ==(Selections left, Selections right)
Parameters
Type Name Description
Selections left

The left object

Selections right

The right object

Returns
Type Description
Boolean

true if the objects are equal; otherwise, false.

Inequality(Selections, Selections)

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

Declaration
public static bool operator !=(Selections left, Selections right)
Parameters
Type Name Description
Selections left

The left object

Selections right

The right object

Returns
Type Description
Boolean

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

Implements

System.IEquatable<T>
IInterfaceUri
ICloneable<T>
System.IEquatable<T>

Extension Methods

SolverUtils.PurgeRestrictions(Selections)
In This Article
Back to top Copyright Bastian Eicher et al