Class ImplementationSelection
- Namespace
- ZeroInstall.Model.Selection
- Assembly
- ZeroInstall.Model.dll
An executable implementation of a Feed as a part of a Selections.
[Equatable]
public sealed class ImplementationSelection : ImplementationBase, IEquatable<XmlUnknown>, IEquatable<FeedElement>, IEquatable<TargetBase>, IDependencyContainer, ICloneable<Element>, IEquatable<Element>, IEquatable<ImplementationBase>, IInterfaceUriBindingContainer, IInterfaceUri, IBindingContainer, ICloneable<ImplementationSelection>, IComparable<ImplementationSelection>, IEquatable<ImplementationSelection>
- Inheritance
-
ImplementationSelection
- Implements
- Inherited Members
- Extension Methods
Remarks
This class does not contain information on how to download the implementation in case it is not in cache. That must be obtained from a Implementation instance.
Constructors
ImplementationSelection()
Used for XML serialization.
public ImplementationSelection()
ImplementationSelection(IReadOnlyList<SelectionCandidate>)
Creates a new implementation selection.
public ImplementationSelection(IReadOnlyList<SelectionCandidate> candidates)
Parameters
candidates
IReadOnlyList<SelectionCandidate>All candidates that were considered for selection (including the selected one). These are used to present the user with possible alternatives.
Properties
Candidates
All Implementations that were considered by the solver when this one was chosen.
null
when selections are loaded from a file.
[Browsable(false)]
[IgnoreEquality]
public IReadOnlyList<SelectionCandidate>? Candidates { get; }
Property Value
Distribution
The name of the distribution (e.g. Debian, RPM) where this implementation comes from, if any.
[Browsable(false)]
[IgnoreEquality]
public string? Distribution { get; }
Property Value
FromFeed
The URL or local path of the feed that contains this implementation.
FromDistributionPrefix is prepended if data is pulled from a native package manager.
If null
or Empty use InterfaceUri instead.
public FeedUri? FromFeed { get; set; }
Property Value
InterfaceUri
The URI or local path of the interface this implementation is for.
public required FeedUri InterfaceUri { get; set; }
Property Value
QuickTestFile
A file which, if present, indicates that the selection is still valid. This is sometimes used with distribution-provided selections. If not present and the ID starts with "package:", you'll need to query the distribution's package manager to check that this version is still installed.
public string? QuickTestFile { get; set; }
Property Value
Methods
Clone()
Creates a deep copy of this ImplementationSelection instance.
public override Element Clone()
Returns
- Element
The new copy of the ImplementationSelection.
CompareTo(ImplementationSelection?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(ImplementationSelection? other)
Parameters
other
ImplementationSelectionAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes other
in the sort order.Zero This instance occurs in the same position in the sort order as other
.Greater than zero This instance follows other
in the sort order.
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe 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.
Normalize(FeedUri?)
Flattens inheritance structures, Converts legacy elements, sets default values, etc..
public override void Normalize(FeedUri? feedUri = null)
Parameters
feedUri
FeedUriThe feed the data was originally loaded from.
Exceptions
- InvalidDataException
A required property is not set or invalid.
ToString()
Returns the implementation in the form "Comma-separated list of set values". Not safe for parsing!
public override string ToString()
Returns
Operators
operator ==(ImplementationSelection?, ImplementationSelection?)
Indicates whether the object on the left is equal to the object on the right.
public static bool operator ==(ImplementationSelection? left, ImplementationSelection? right)
Parameters
left
ImplementationSelectionThe left object
right
ImplementationSelectionThe right object
Returns
- bool
true if the objects are equal; otherwise, false.
operator !=(ImplementationSelection?, ImplementationSelection?)
Indicates whether the object on the left is not equal to the object on the right.
public static bool operator !=(ImplementationSelection? left, ImplementationSelection? right)
Parameters
left
ImplementationSelectionThe left object
right
ImplementationSelectionThe right object
Returns
- bool
true if the objects are not equal; otherwise, false.