Table of Contents

Class Category

Namespace
ZeroInstall.Model
Assembly
ZeroInstall.Model.dll

An application category (e.g. Game or Office). Used for organizing application menus.

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

Fields

WellKnownNames

Well-known values for Name if TypeNamespace is empty.

public static readonly string[] WellKnownNames

Field Value

string[]

Properties

Name

The category name as specified by the TypeNamespace.

[TypeConverter(typeof(CategoryNameConverter))]
public string? Name { get; set; }

Property Value

string

TypeNamespace

If no type is given, then the category is one of the 'Main' categories defined by the freedesktop.org menu specification (http://standards.freedesktop.org/menu-spec/latest/apa.html). Otherwise, it is a URI giving the namespace for the category.

public string? TypeNamespace { get; set; }

Property Value

string

Methods

Clone()

Creates a plain copy of this category.

public Category Clone()

Returns

Category

The cloned category.

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.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns Name directly. Safe for parsing!

public override string ToString()

Returns

string

Operators

operator ==(Category?, Category?)

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

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

Parameters

left Category

The left object

right Category

The right object

Returns

bool

true if the objects are equal; otherwise, false.

implicit operator Category(string)

Convenience cast for turning strings into Categorys.

public static implicit operator Category(string value)

Parameters

value string

Returns

Category

operator !=(Category?, Category?)

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

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

Parameters

left Category

The left object

right Category

The right object

Returns

bool

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