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
MimeTypeIco
The MimeType value for Windows icons (.ico).
public const string MimeTypeIco = "image/vnd.microsoft.icon"
Field Value
MimeTypePng
The MimeType value for PNG icons (.png(.
public const string MimeTypePng = "image/png"
Field Value
MimeTypeSvg
The MimeType value for SVG icons (.svg).
public const string MimeTypeSvg = "image/svg"
Field Value
Properties
Href
The URL used to locate the icon.
[Browsable(false)]
public required Uri Href { get; set; }
Property Value
MimeType
The MIME type of the icon. This value is case-insensitive.
[TypeConverter(typeof(IconMimeTypeConverter))]
public string? MimeType { get; set; }
Property Value
Methods
Clone()
Creates a deep copy of this Icon instance.
public Icon Clone()
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
Equals(Icon?)
protected bool Equals(Icon? other)
Parameters
other
Icon
Returns
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
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
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
Returns
- bool
true if the objects are not equal; otherwise, false.