Table of Contents

Struct Priority

Namespace
AngleSharp.Css
Assembly
AngleSharp.dll

A priority object for comparing priorities.

public readonly struct Priority : IEquatable<Priority>, IComparable<Priority>
Implements
Inherited Members
Extension Methods

Constructors

Priority(byte, byte, byte, byte)

Creates a new priority with the given values.

public Priority(byte inlines, byte ids, byte classes, byte tags)

Parameters

inlines byte

The number of inlines.

ids byte

The number of ids.

classes byte

The number of classes.

tags byte

The number of tags.

Priority(uint)

Creates a new priority with the given hashcode.

public Priority(uint priority)

Parameters

priority uint

The hashcode to use.

Fields

Inline

Gets the priority for having an inline element.

public static readonly Priority Inline

Field Value

Priority

OneClass

Gets the priority for having a single class.

public static readonly Priority OneClass

Field Value

Priority

OneId

Gets the priority for having a single Id.

public static readonly Priority OneId

Field Value

Priority

OneTag

Gets the priority for having a single tag.

public static readonly Priority OneTag

Field Value

Priority

Zero

Gets the lowest (zero) priority.

public static readonly Priority Zero

Field Value

Priority

Properties

Classes

Gets the number of classes for this priority.

public byte Classes { get; }

Property Value

byte

Ids

Gets the number of ids for this priority.

public byte Ids { get; }

Property Value

byte

Inlines

Gets the number of inlines for this priority.

public byte Inlines { get; }

Property Value

byte

Tags

Gets the number of tags for this priority.

public byte Tags { get; }

Property Value

byte

Methods

CompareTo(Priority)

Compares the current priority with another priority.

public int CompareTo(Priority other)

Parameters

other Priority

The priority to compare to.

Returns

int

A value greater than 1 if the current priority is larger.

Equals(Priority)

Checks two priorities for equality.

public bool Equals(Priority other)

Parameters

other Priority

The other priority.

Returns

bool

True if both priorities or equal, otherwise false.

Equals(object?)

Tests if another object is equal to this object.

public override bool Equals(object? obj)

Parameters

obj object

The object to test with.

Returns

bool

True if the two objects are equal, otherwise false.

GetHashCode()

Returns a hash code that defines the current priority.

public override int GetHashCode()

Returns

int

The integer value of the hashcode.

ToString()

Returns a string representing the priority.

public override string ToString()

Returns

string

The string representation.

Operators

operator +(Priority, Priority)

Adds the two given priorities.

public static Priority operator +(Priority a, Priority b)

Parameters

a Priority

The first priority.

b Priority

The second priority.

Returns

Priority

The result of adding the two priorities.

operator ==(Priority, Priority)

Compares two priorities and returns a boolean indicating if the two do match.

public static bool operator ==(Priority a, Priority b)

Parameters

a Priority

The first priority to use.

b Priority

The second priority to use.

Returns

bool

True if both priorities are equal, otherwise false.

operator >(Priority, Priority)

Compares two priorities and returns a boolean indicating if the first one is greater.

public static bool operator >(Priority a, Priority b)

Parameters

a Priority

The first priority to use.

b Priority

The second priority to use.

Returns

bool

True if the first priority is higher, otherwise false.

operator >=(Priority, Priority)

Compares two priorities and returns a boolean indicating if the first one is greater or equal.

public static bool operator >=(Priority a, Priority b)

Parameters

a Priority

The first priority to use.

b Priority

The second priority to use.

Returns

bool

True if the first priority is higher or equal, otherwise false.

operator !=(Priority, Priority)

Compares two priorities and returns a boolean indicating if the two do not match.

public static bool operator !=(Priority a, Priority b)

Parameters

a Priority

The first priority to use.

b Priority

The second color to use.

Returns

bool

True if both priorities are not equal, otherwise false.

operator <(Priority, Priority)

Compares two priorities and returns a boolean indicating if the second one is greater.

public static bool operator <(Priority a, Priority b)

Parameters

a Priority

The first priority to use.

b Priority

The second priority to use.

Returns

bool

True if the second priority is higher, otherwise false.

operator <=(Priority, Priority)

Compares two priorities and returns a boolean indicating if the second one is greater or equal.

public static bool operator <=(Priority a, Priority b)

Parameters

a Priority

The first priority to use.

b Priority

The second priority to use.

Returns

bool

True if the second priority is higher or equal, otherwise false.