Show / Hide Table of Contents

Class Feed

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

Inheritance
Object
XmlUnknown
Feed
Implements
IEquatable<XmlUnknown>
IElementContainer
ISummaryContainer
IDescriptionContainer
IIconContainer
ICloneable<Feed>
IEquatable<Feed>
Inherited Members
XmlUnknown.UnknownAttributes
XmlUnknown.UnknownElements
XmlUnknown.EnsureAttribute(Object, String)
XmlUnknown.EnsureAttributeSafeID(String, String)
XmlUnknown.ToShortXml()
XmlUnknown.Equals(XmlUnknown)
Namespace: ZeroInstall.Model
Assembly: ZeroInstall.Model.dll
Syntax
public class Feed : XmlUnknown, IElementContainer, ISummaryContainer, IDescriptionContainer, IIconContainer
Remarks

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

Constructors

Feed()

Declaration
public Feed()

Fields

SchemaLocation

Provides XML Editors with location hints for XSD files.

Declaration
public string SchemaLocation
Field Value
Type Description
String

XmlNamespace

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

Declaration
public const string XmlNamespace = "http://zero-install.sourceforge.net/2004/injector/interface"
Field Value
Type Description
String

XsdLocation

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

Declaration
public const string XsdLocation = "https://docs.0install.net/specifications/feed.xsd"
Field Value
Type Description
String

XsiSchemaLocation

Provides XML Editors with location hints for XSD files.

Declaration
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
Type Description
String

Properties

CapabilityLists

A set of Capability lists for different architectures.

Declaration
public List<CapabilityList> CapabilityLists { get; }
Property Value
Type Description
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!

Declaration
public FeedUri CatalogUri { get; set; }
Property Value
Type Description
FeedUri

CatalogUriString

Used for XML serialization and PropertyGrid.

Declaration
public string CatalogUriString { get; set; }
Property Value
Type Description
String
See Also
CatalogUri

Categories

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

Declaration
public List<Category> Categories { get; }
Property Value
Type Description
List<Category>

Descriptions

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

Declaration
public LocalizableStringCollection Descriptions { get; }
Property Value
Type Description
LocalizableStringCollection

Elements

A list of Groups and Implementations contained within this interface.

Declaration
public List<Element> Elements { get; }
Property Value
Type Description
List<Element>

EntryPoints

A list of EntryPoints for starting this interface.

Declaration
public List<EntryPoint> EntryPoints { get; }
Property Value
Type Description
List<EntryPoint>

FeedFor

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

Declaration
public List<InterfaceReference> FeedFor { get; }
Property Value
Type Description
List<InterfaceReference>

Feeds

Zero ore more additional feeds containing implementations of this interface.

Declaration
public List<FeedReference> Feeds { get; }
Property Value
Type Description
List<FeedReference>

Homepage

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

Declaration
public Uri Homepage { get; set; }
Property Value
Type Description
Uri

HomepageString

Used for XML serialization and PropertyGrid.

Declaration
public string HomepageString { get; set; }
Property Value
Type Description
String
See Also
Homepage

Icons

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

Declaration
public List<Icon> Icons { get; }
Property Value
Type Description
List<Icon>

Implementations

A flat list of all Implementations contained in this feed.

Declaration
public IEnumerable<Implementation> Implementations { get; }
Property Value
Type Description
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.

Item[String]

Returns the Implementation with a specific ID string.

Declaration
public Implementation this[string id] { get; }
Parameters
Type Name Description
String id

The ID to look for.

Property Value
Type Description
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
Type Condition
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.

Declaration
public ImplementationVersion MinInjectorVersion { get; set; }
Property Value
Type Description
ImplementationVersion

MinInjectorVersionString

Used for XML serialization.

Declaration
public string MinInjectorVersionString { get; set; }
Property Value
Type Description
String
See Also
MinInjectorVersion

Name

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

Declaration
public string Name { get; set; }
Property Value
Type Description
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.

Declaration
public bool NeedsTerminal { get; set; }
Property Value
Type Description
Boolean

NeedsTerminalString

Used for XML serialization.

Declaration
public string NeedsTerminalString { get; set; }
Property Value
Type Description
String
See Also
NeedsTerminal

Publisher

The publisher (company or organization) of the program.

Declaration
public string Publisher { get; set; }
Property Value
Type Description
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.

Declaration
public InterfaceReference ReplacedBy { get; set; }
Property Value
Type Description
InterfaceReference
See Also
ManifestDigest

SplashScreens

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

Declaration
public List<Icon> SplashScreens { get; }
Property Value
Type Description
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").

Declaration
public LocalizableStringCollection Summaries { get; }
Property Value
Type Description
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).

Declaration
public FeedUri Uri { get; set; }
Property Value
Type Description
FeedUri

UriString

Used for XML serialization and PropertyGrid.

Declaration
public string UriString { get; set; }
Property Value
Type Description
String
See Also
Uri

Methods

Clone()

Creates a deep copy of this Feed instance.

Declaration
public Feed Clone()
Returns
Type Description
Feed

The new copy of the Feed.

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
Boolean

Equals(Feed)

Declaration
public bool Equals(Feed other)
Parameters
Type Name Description
Feed other
Returns
Type Description
Boolean

GetBestIcon(String, String)

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

Declaration
public Icon GetBestIcon(string mimeType, string command)
Parameters
Type Name Description
String mimeType

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

String command

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

Returns
Type Description
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.

Declaration
public string GetBestName(CultureInfo language, string command)
Parameters
Type Name Description
CultureInfo language

The language to look for; use InvariantCulture for none.

String command

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

Returns
Type Description
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.

Declaration
public string GetBestSummary(CultureInfo language, string command)
Parameters
Type Name Description
CultureInfo language

The language to look for; use InvariantCulture for none.

String command

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

Returns
Type Description
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.

Declaration
public EntryPoint GetEntryPoint(string command)
Parameters
Type Name Description
String command

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

Returns
Type Description
EntryPoint

The identified EntryPoint; null no matching one was found.

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
Int32
Overrides
XmlUnknown.GetHashCode()

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.

Declaration
public void Normalize(FeedUri feedUri = null)
Parameters
Type Name Description
FeedUri feedUri

The URI the feed was originally loaded from.

Exceptions
Type Condition
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.

Declaration
public bool RemoveImplementation(string id)
Parameters
Type Name Description
String id
Returns
Type Description
Boolean

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

ResolveInternalReferences()

Resolves references between elements within the Feed.

Declaration
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
Type Condition
InvalidDataException

A reference could not be resolved.

Strip()

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

Declaration
public void Strip()

ToString()

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

Declaration
public override string ToString()
Returns
Type Description
String

Operators

Equality(Feed, Feed)

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

Declaration
public static bool operator ==(Feed left, Feed right)
Parameters
Type Name Description
Feed left

The left object

Feed right

The right object

Returns
Type Description
Boolean

true if the objects are equal; otherwise, false.

Inequality(Feed, Feed)

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

Declaration
public static bool operator !=(Feed left, Feed right)
Parameters
Type Name Description
Feed left

The left object

Feed right

The right object

Returns
Type Description
Boolean

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

Implements

System.IEquatable<T>
IElementContainer
ISummaryContainer
IDescriptionContainer
IIconContainer
ICloneable<T>
System.IEquatable<T>
In This Article
Back to top Copyright Bastian Eicher et al