Zero Install .NET API 2.20.0
ZeroInstall.DesktopIntegration.AppList Class Reference

Stores a list of applications and the kind of desktop integration the user chose for them. More...

Inheritance diagram for ZeroInstall.DesktopIntegration.AppList:
ZeroInstall.Model.XmlUnknown NanoByte.Common.ICloneable< AppList >

Public Member Functions

bool ContainsEntry (FeedUri interfaceUri)
 Checks whether an AppEntry for a specific interface URI exists. More...
 
AppEntryGetEntry (FeedUri interfaceUri)
 Gets an AppEntry for a specific interface URI. Safe for missing elements. More...
 
IEnumerable< AppEntrySearch (string? query)
 Returns all AppEntrys that match a specific search query. More...
 
AppAlias AppEntry? appEntry FindAppAlias (string aliasName)
 
FeedUriResolveAlias (string aliasName)
 Retrieves the target URI of a specific AppAlias. More...
 
void SaveXmlZip (Stream stream, string? password=null)
 Saves the list in an XML file embedded in a ZIP archive. More...
 
AppList Clone ()
 Creates a deep copy of this AppList instance. More...
 
bool Equals (AppList? 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< AppList >
AppList Clone ()
 

Static Public Member Functions

static string GetDefaultPath (bool machineWide=false)
 Returns the default file path used to store the main AppList on this system. More...
 
static AppList LoadSafe (bool machineWide=false)
 Tries to load the AppList from its default location. Automatically falls back to an empty list on errors. More...
 
static AppList LoadXmlZip (Stream stream, string? password=null)
 Loads a list from an XML file embedded in a ZIP archive. More...
 

Public Attributes

string XsiSchemaLocation = XmlNamespace + " " + XsdLocation
 Provides XML Editors with location hints for XSD files.
 
AppAlias alias
 Retrieves a specific AppAlias. More...
 
- Public Attributes inherited from ZeroInstall.Model.XmlUnknown
XmlAttribute?[] UnknownAttributes
 Contains any unknown additional XML attributes.
 
XmlElement?[] UnknownElements
 Contains any unknown additional XML elements.
 

Static Public Attributes

const string XmlNamespace = "http://0install.de/schema/desktop-integration/app-list"
 The XML namespace used for storing application list data.
 
const string XsdLocation = "https://docs.0install.net/specifications/app-list.xsd"
 The URI to retrieve an XSD containing the XML Schema information for this class in serialized form.
 

Properties

List< AppEntryEntries = new() [get]
 A list of AppEntrys.
 
AppEntry this[FeedUri interfaceUri] [get]
 Gets an AppEntry for a specific interface URI. More...
 

Additional Inherited Members

- 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

Stores a list of applications and the kind of desktop integration the user chose for them.

Member Function Documentation

◆ Clone()

AppList ZeroInstall.DesktopIntegration.AppList.Clone ( )
inline

Creates a deep copy of this AppList instance.

Returns
The new copy of the AppList.

◆ ContainsEntry()

bool ZeroInstall.DesktopIntegration.AppList.ContainsEntry ( FeedUri  interfaceUri)
inline

Checks whether an AppEntry for a specific interface URI exists.

Parameters
interfaceUriThe AppEntry.InterfaceUri to look for.
Returns
true if a matching entry was found; false otherwise.

◆ GetDefaultPath()

static string ZeroInstall.DesktopIntegration.AppList.GetDefaultPath ( bool  machineWide = false)
static

Returns the default file path used to store the main AppList on this system.

Parameters
machineWideStore the AppList machine-wide instead of just for the current user.

◆ GetEntry()

AppEntry? ZeroInstall.DesktopIntegration.AppList.GetEntry ( FeedUri  interfaceUri)
inline

Gets an AppEntry for a specific interface URI. Safe for missing elements.

Parameters
interfaceUriThe AppEntry.InterfaceUri to look for.
Returns
The first matching AppEntry; null if no match was found.

◆ LoadSafe()

static AppList ZeroInstall.DesktopIntegration.AppList.LoadSafe ( bool  machineWide = false)
inlinestatic

Tries to load the AppList from its default location. Automatically falls back to an empty list on errors.

Parameters
machineWideLoad the machine-wide AppList instead of the one for the current user.
Returns
The loaded AppList.

◆ LoadXmlZip()

static AppList ZeroInstall.DesktopIntegration.AppList.LoadXmlZip ( Stream  stream,
string?  password = null 
)
inlinestatic

Loads a list from an XML file embedded in a ZIP archive.

Parameters
streamThe ZIP archive to load.
passwordThe password to use for decryption; null for no encryption.
Returns
The loaded list.
Exceptions
ZipExceptionA problem occurred while reading the ZIP data or password is wrong.
InvalidDataExceptionA problem occurred while deserializing the XML data.

◆ ResolveAlias()

FeedUri? ZeroInstall.DesktopIntegration.AppList.ResolveAlias ( string  aliasName)

Retrieves the target URI of a specific AppAlias.

Parameters
aliasNameThe name of the alias to search for.
Returns
The target feed of the alias; null if none was found.

◆ SaveXmlZip()

void ZeroInstall.DesktopIntegration.AppList.SaveXmlZip ( Stream  stream,
string?  password = null 
)
inline

Saves the list in an XML file embedded in a ZIP archive.

Parameters
streamThe ZIP archive to be written.
passwordThe password to use for encryption; null for no encryption.

◆ Search()

IEnumerable< AppEntry > ZeroInstall.DesktopIntegration.AppList.Search ( string?  query)
inline

Returns all AppEntrys that match a specific search query.

Parameters
queryThe search query. Must be contained within AppEntry.Name.
Returns
All AppEntrys matching query .

Member Data Documentation

◆ alias

AppAlias ZeroInstall.DesktopIntegration.AppList.alias

Retrieves a specific AppAlias.

Parameters
aliasNameThe name of the alias to search for.
Returns
The first AppAlias matching aliasName and the AppEntry containing it; null if none was found.

Property Documentation

◆ this[FeedUri interfaceUri]

AppEntry ZeroInstall.DesktopIntegration.AppList.this[FeedUri interfaceUri]
get

Gets an AppEntry for a specific interface URI.

Parameters
interfaceUriThe AppEntry.InterfaceUri to look for.
Returns
The first matching AppEntry.
Exceptions
KeyNotFoundExceptionNo entry matching the interface URI was found.

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