Zero Install .NET API 2.20.0
ZeroInstall.Model.Selection.Selections Class Reference

Represents a set of ImplementationBases chosen by a solver. More...

Inheritance diagram for ZeroInstall.Model.Selection.Selections:
ZeroInstall.Model.XmlUnknown ZeroInstall.Model.IInterfaceUri NanoByte.Common.ICloneable< Selections >

Public Member Functions

IEnumerable< RestrictionRestrictionsFor (FeedUri interfaceUri)
 Gets a list of all Restrictions and Dependency that point to a specific interfaceUri .
 
 Selections ()
 Creates an empty selections document.
 
 Selections (IEnumerable< ImplementationSelection > implementations)
 Creates a selections document pre-filled with ImplementationSelections.
 
bool ContainsImplementation (FeedUri interfaceUri)
 Determines whether an ImplementationSelection for a specific interface is listed in the selection. More...
 
ImplementationSelectionGetImplementation (FeedUri interfaceUri)
 Returns the ImplementationSelection for a specific interface. Safe for missing elements. More...
 
void Normalize ()
 Calls ImplementationBase.Normalize for all Implementations. More...
 
Selections Clone ()
 Creates a deep copy of this Selections instance. More...
 
override string ToString ()
 Returns the selections as XML. Not safe for parsing!
 
bool Equals (Selections? other)
 
override bool Equals (object? obj)
 
override int GetHashCode ()
 
- Public Member Functions inherited from ZeroInstall.Model.XmlUnknown
string ToShortXml ()
 Returns a shortened XML representation (with attributes but without child elements). More...
 
override int GetHashCode ()
 
- Public Member Functions inherited from NanoByte.Common.ICloneable< Selections >
Selections Clone ()
 

Properties

FeedUri InterfaceUri = default! [getset]
 The URI or local path of the interface this selection is based on.
 
string? InterfaceUriString [getset]
 Used for XML serialization. More...
 
string Name = default! [getset]
 The name specified by the feed at InterfaceUri.
 
bool Source [getset]
 Indicates whether the selection was generated for Cpu.Source.
 
string? Command [getset]
 The name of the Command in the interface to be started.
 
List< ImplementationSelectionImplementations = new() [get]
 A list of ImplementationSelections chosen in this selection.
 
ImplementationSelection MainImplementation [get]
 The main implementation in the selection (the actual program to launch). Identified by InterfaceUri. More...
 
bool Is32Bit [get]
 Indicates whether the CPU architecture of one or more Implementations is 32-bit.
 
bool Is64Bit [get]
 Indicates whether the CPU architecture of one or more Implementations is 64-bit.
 
ImplementationSelection this[FeedUri interfaceUri] [get]
 Returns the ImplementationSelection for a specific interface. More...
 
- Properties inherited from ZeroInstall.Model.IInterfaceUri
FeedUri InterfaceUri [getset]
 An interface URI (URL or file path).
 

Additional Inherited Members

- Public Attributes inherited from ZeroInstall.Model.XmlUnknown
XmlAttribute?[] UnknownAttributes
 Contains any unknown additional XML attributes.
 
XmlElement?[] UnknownElements
 Contains any unknown additional XML elements.
 
- Protected Member Functions inherited from ZeroInstall.Model.XmlUnknown
void EnsureAttribute (object? value, string attributeName)
 Ensures that a value deserialized from an XML attribute is set (not null). More...
 
void EnsureAttributeSafeID (string? value, string attributeName)
 Ensures that a value deserialized from an XML attribute is set (not null) and only contains alphanumeric characters, spaces ( ), dots (.), underscores (_), hyphens (-) and plus signs (+). More...
 
bool Equals (XmlUnknown? other)
 

Detailed Description

Represents a set of ImplementationBases chosen by a solver.

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

Member Function Documentation

◆ Clone()

Selections ZeroInstall.Model.Selection.Selections.Clone ( )
inline

Creates a deep copy of this Selections instance.

Returns
The new copy of the Selections.

◆ ContainsImplementation()

bool ZeroInstall.Model.Selection.Selections.ContainsImplementation ( FeedUri  interfaceUri)

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

Parameters
interfaceUriThe ImplementationSelection.InterfaceUri to look for.
Returns
true if an implementation was found; false otherwise.

◆ GetImplementation()

ImplementationSelection? ZeroInstall.Model.Selection.Selections.GetImplementation ( FeedUri  interfaceUri)
inline

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

Parameters
interfaceUriThe ImplementationSelection.InterfaceUri to look for.
Returns
The first matching implementation; null if no matching one was found.

◆ Normalize()

void ZeroInstall.Model.Selection.Selections.Normalize ( )
inline

Calls ImplementationBase.Normalize for all Implementations.

Exceptions
InvalidDataExceptionA required property is not set or invalid.

Property Documentation

◆ InterfaceUriString

string? ZeroInstall.Model.Selection.Selections.InterfaceUriString
getset

Used for XML serialization.

See also
InterfaceUri

◆ MainImplementation

ImplementationSelection ZeroInstall.Model.Selection.Selections.MainImplementation
get

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

Exceptions
KeyNotFoundExceptionNo ImplementationSelection matching InterfaceUri was found in Implementations.

◆ this[FeedUri interfaceUri]

ImplementationSelection ZeroInstall.Model.Selection.Selections.this[FeedUri interfaceUri]
get

Returns the ImplementationSelection for a specific interface.

Parameters
interfaceUriThe ImplementationSelection.InterfaceUri to look for.
Returns
The first matching implementation.
Exceptions
KeyNotFoundExceptionNo matching implementation was found.

The documentation for this class was generated from the following file: