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
Implementations
A list of ImplementationSelections chosen in this selection.
[UnorderedEquality]
public List<ImplementationSelection> Implementations { get; }
Property Value
InterfaceUri
The URI or local path of the interface this selection is based on.
public required FeedUri InterfaceUri { get; set; }
Property Value
this[FeedUri]
Returns the ImplementationSelection for a specific interface.
public ImplementationSelection this[FeedUri interfaceUri] { get; }
Parameters
interfaceUriFeedUriThe 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
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
Source
Indicates whether the selection was generated for Source.
public bool Source { get; set; }
Property Value
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
interfaceUriFeedUriThe InterfaceUri to look for.
Returns
- bool
trueif an implementation was found;falseotherwise.
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
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
interfaceUriFeedUriThe InterfaceUri to look for.
Returns
- ImplementationSelection
The first matching implementation;
nullif no matching one was found.
Normalize()
Calls Normalize(FeedUri?) for all Implementations.
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
interfaceUriFeedUri
Returns
ToString()
Returns the selections as XML. Not safe for parsing!
public override string ToString()
Returns
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
leftSelectionsThe left object
rightSelectionsThe 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
leftSelectionsThe left object
rightSelectionsThe right object
Returns
- bool
true if the objects are not equal; otherwise, false.