Table of Contents

Class Icon

Namespace
ZeroInstall.Model
Assembly
ZeroInstall.Model.dll

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

[Serializable]
[Equatable]
public class Icon : FeedElement, IEquatable<XmlUnknown>, IEquatable<FeedElement>, ICloneable<Icon>, IEquatable<Icon>
Inheritance
Icon
Implements
Inherited Members

Fields

KnownMimeTypes

All known MimeType values for icons.

public static readonly string[] KnownMimeTypes

Field Value

string[]

MimeTypeIcns

The MimeType value for Apple icons (.icns).

public const string MimeTypeIcns = "image/x-icns"

Field Value

string

MimeTypeIco

The MimeType value for Windows icons (.ico).

public const string MimeTypeIco = "image/vnd.microsoft.icon"

Field Value

string

MimeTypePng

The MimeType value for PNG icons (.png(.

public const string MimeTypePng = "image/png"

Field Value

string

MimeTypeSvg

The MimeType value for SVG icons (.svg).

public const string MimeTypeSvg = "image/svg"

Field Value

string

Properties

Href

The URL used to locate the icon.

[Browsable(false)]
public required Uri Href { get; set; }

Property Value

Uri

MimeType

The MIME type of the icon. This value is case-insensitive.

[TypeConverter(typeof(IconMimeTypeConverter))]
public string? MimeType { get; set; }

Property Value

string

Methods

Clone()

Creates a deep copy of this Icon instance.

public Icon Clone()

Returns

Icon

The new copy of the Icon.

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(Icon?)

protected bool Equals(Icon? other)

Parameters

other Icon

Returns

bool

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Normalize()

Converts legacy elements, sets default values, etc..

public void Normalize()

Exceptions

InvalidDataException

A required property is not set or invalid.

ToString()

Returns the icon in the form "Location (MimeType)". Not safe for parsing!

public override string ToString()

Returns

string

Operators

operator ==(Icon?, Icon?)

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

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

Parameters

left Icon

The left object

right Icon

The right object

Returns

bool

true if the objects are equal; otherwise, false.

operator !=(Icon?, Icon?)

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

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

Parameters

left Icon

The left object

right Icon

The right object

Returns

bool

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

See Also