Table of Contents

Class Feed

Namespace
ZeroInstall.Model
Assembly
ZeroInstall.Model.dll

A feed contains all the information required to download and execute an application.

[Serializable]
[XmlNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance")]
[Equatable]
public class Feed : XmlUnknown, IEquatable<XmlUnknown>, IElementContainer, ISummaryContainer, IDescriptionContainer, IIconContainer, ICloneable<Feed>, IEquatable<Feed>
Inheritance
Feed
Implements
Inherited Members

Remarks

Fields

SchemaLocation

Provides XML Editors with location hints for XSD files.

public string? SchemaLocation

Field Value

string

XmlNamespace

The XML namespace used for storing feed/interface-related data.

public const string XmlNamespace = "http://zero-install.sourceforge.net/2004/injector/interface"

Field Value

string

XsdLocation

The URI to retrieve an XSD containing the XML Schema information for this class in serialized form.

public const string XsdLocation = "https://docs.0install.net/specifications/feed.xsd"

Field Value

string

XsiSchemaLocation

Provides XML Editors with location hints for XSD files.

public const string XsiSchemaLocation = "http://zero-install.sourceforge.net/2004/injector/interface https://docs.0install.net/specifications/feed.xsd http://0install.de/schema/desktop-integration/capabilities https://docs.0install.net/specifications/capabilities.xsd"

Field Value

string

Properties

CapabilityLists

A set of Capability lists for different architectures.

[Browsable(false)]
[OrderedEquality]
public List<CapabilityList> CapabilityLists { get; }

Property Value

List<CapabilityList>

CatalogUri

The URI of the Catalog this feed was stored within. Used as an implementation detail; not part of the regular feed format!

[Browsable(false)]
[IgnoreEquality]
public FeedUri? CatalogUri { get; set; }

Property Value

FeedUri

Categories

A list of well-known categories the applications fits into. May influence the placement in the application menu.

[Browsable(false)]
[OrderedEquality]
public List<Category> Categories { get; }

Property Value

List<Category>

Descriptions

Full descriptions for different languages, which can be several paragraphs long.

[Browsable(false)]
[OrderedEquality]
public LocalizableStringCollection Descriptions { get; }

Property Value

LocalizableStringCollection

Elements

A list of Groups and Implementations contained within this interface.

[Browsable(false)]
[OrderedEquality]
public List<Element> Elements { get; }

Property Value

List<Element>

EntryPoints

A list of EntryPoints for starting this interface.

[Browsable(false)]
[OrderedEquality]
public List<EntryPoint> EntryPoints { get; }

Property Value

List<EntryPoint>

FeedFor

The implementations in this feed are implementations of the given interface. This is used when adding a third-party feed.

[Browsable(false)]
[OrderedEquality]
public List<InterfaceReference> FeedFor { get; }

Property Value

List<InterfaceReference>

Feeds

Zero ore more additional feeds containing implementations of this interface.

[Browsable(false)]
[OrderedEquality]
public List<FeedReference> Feeds { get; }

Property Value

List<FeedReference>

Homepage

The URL of a web-page describing feed or program in more detail.

[Browsable(false)]
public Uri? Homepage { get; set; }

Property Value

Uri

Icons

Icons representing the application. Used in the Catalog GUI as well as for desktop icons, menu entries, etc..

[Browsable(false)]
[OrderedEquality]
public List<Icon> Icons { get; }

Property Value

List<Icon>

Implementations

A flat list of all Implementations contained in this feed.

[Browsable(false)]
[IgnoreEquality]
public IEnumerable<Implementation> Implementations { get; }

Property Value

IEnumerable<Implementation>

Remarks

If this is used before Normalize(FeedUri?) has been called, incomplete Implementations may be returned, because the Group inheritance structure has not been resolved.

this[string]

Returns the Implementation with a specific ID string.

public Implementation this[string id] { get; }

Parameters

id string

The ID to look for.

Property Value

Implementation

The identified Implementation.

Remarks

If this is used before Normalize(FeedUri?) has been called, incomplete Implementations may be returned, because the Group inheritance structure has not been resolved.

Exceptions

KeyNotFoundException

No Implementation matching id was found in Elements.

MinInjectorVersion

This attribute gives the oldest version of the injector that can read this file. Older versions will tell the user to upgrade if they are asked to read the file. Versions prior to 0.20 do not perform this check, however. If the attribute is not present, the file can be read by all versions.

[Browsable(false)]
public ImplementationVersion? MinInjectorVersion { get; set; }

Property Value

ImplementationVersion

Name

A short name to identify the feed or program (e.g. "Foo").

public required string Name { get; set; }

Property Value

string

NeedsTerminal

If true, indicates that the program requires a terminal in order to run. Graphical launchers should therefore run this program in a suitable terminal emulator.

[Browsable(false)]
public bool NeedsTerminal { get; set; }

Property Value

bool

Publisher

The publisher (company or organization) of the program.

public string? Publisher { get; set; }

Property Value

string

ReplacedBy

This interface Uri of the feed has been replaced by the given interface. Any references to the old URI should be updated to use the new one.

[Browsable(false)]
public InterfaceReference? ReplacedBy { get; set; }

Property Value

InterfaceReference
See Also

SplashScreens

Splash screens Zero Install can display during downloads, etc. for better branding.

[Browsable(false)]
[OrderedEquality]
public List<Icon> SplashScreens { get; }

Property Value

List<Icon>

Summaries

Short one-line descriptions for different languages; the first word should not be upper-case unless it is a proper noun (e.g. "cures all ills").

[Browsable(false)]
[OrderedEquality]
public LocalizableStringCollection Summaries { get; }

Property Value

LocalizableStringCollection

Uri

This attribute is only needed for remote feeds (fetched via HTTP). The value must exactly match the expected URL, to prevent an attacker replacing one correctly-signed feed with another (e.g., returning a feed for the shred program when the user asked for the backup program).

[Browsable(false)]
public FeedUri? Uri { get; set; }

Property Value

FeedUri

Methods

Clone()

Creates a deep copy of this Feed instance.

public Feed Clone()

Returns

Feed

The new copy of the Feed.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(Feed?)

protected bool Equals(Feed? other)

Parameters

other Feed

Returns

bool

GetBestIcon(string, string?)

Returns the best matching icon for a specific Command/EntryPoint. Will fall back to Icons.

public Icon? GetBestIcon(string mimeType, string? command)

Parameters

mimeType string

The MimeType to try to find. Will only return exact matches.

command string

The name of the command the icon should represent; null is equivalent to NameRun.

Returns

Icon

The best matching icon that was found or null if no matching icon was found.

GetBestName(CultureInfo, string?)

Returns the best matching name for a specific Command/EntryPoint.

public string GetBestName(CultureInfo language, string? command)

Parameters

language CultureInfo

The language to look for; use InvariantCulture for none.

command string

The name of the command the name should represent; null is equivalent to NameRun.

Returns

string

The best matching name that was found.

GetBestSummary(CultureInfo, string?)

Returns the best matching summary for a specific Command/EntryPoint. Will fall back to Summaries.

public string? GetBestSummary(CultureInfo language, string? command)

Parameters

language CultureInfo

The language to look for; use InvariantCulture for none.

command string

The name of the command the summary should represent; null is equivalent to NameRun.

Returns

string

The best matching summary that was found; null if no matching summary was found.

GetEntryPoint(string?)

Returns the first EntryPoint referencing a specific Command.

public EntryPoint? GetEntryPoint(string? command)

Parameters

command string

The command name to search for; null is equivalent to NameRun.

Returns

EntryPoint

The identified EntryPoint; null no matching one was found.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Normalize(FeedUri?)

Prepares the feed for solver processing. Flattens inheritance structures, converts legacy elements, sets default values, etc.. Do not call it if you plan on serializing the feed again since it may loose some of its structure.

public void Normalize(FeedUri? feedUri = null)

Parameters

feedUri FeedUri

The URI the feed was originally loaded from.

Exceptions

NotSupportedException

The feed requires a newer version of Zero Install.

InvalidDataException

A required property is not set or invalid.

RemoveImplementation(string)

Removes an Implementation identified by its ID.

public bool RemoveImplementation(string id)

Parameters

id string

Returns

bool

true if the implementation was removed; false if the implementation could not be found.

ResolveInternalReferences()

Resolves references between elements within the Feed.

public void ResolveInternalReferences()

Remarks

This method should be called instead of Normalize(FeedUri?) if you plan on serializing the feed again since it preservers the structure.

Exceptions

InvalidDataException

A reference could not be resolved.

Strip()

Strips the feed down to the application metadata removing specific Implementations.

public void Strip()

ToString()

Returns the feed/interface in the form "Name (Uri)". Not safe for parsing!

public override string ToString()

Returns

string

Operators

operator ==(Feed?, Feed?)

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

public static bool operator ==(Feed? left, Feed? right)

Parameters

left Feed

The left object

right Feed

The right object

Returns

bool

true if the objects are equal; otherwise, false.

operator !=(Feed?, Feed?)

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

public static bool operator !=(Feed? left, Feed? right)

Parameters

left Feed

The left object

right Feed

The right object

Returns

bool

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