ElementOrCssPseudoElement Struct

The (Element or CSSPseudoElement) union: the originating element or pseudo-element of a pseudo-element.

public readonly struct ElementOrCssPseudoElement : IEquatable<ElementOrCssPseudoElement>
Implements

Properties

NameDescription
ElementGets the value as an Element, or null when the value is a pseudo-element.
PseudoElementGets the value as a CSSPseudoElement, or null when the value is an element.
ValueGets the value: an Element or a CSSPseudoElement.

Gets the value as an Element, or null when the value is a pseudo-element.

public Element? Element { get; }

Property value

Element?

PseudoElement

CssPseudoElement.cs

Gets the value as a CSSPseudoElement, or null when the value is an element.

public CssPseudoElement? PseudoElement { get; }

Property value

CssPseudoElement?

Gets the value: an Element or a CSSPseudoElement.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(ElementOrCssPseudoElement)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
FromCssPseudoElement(CssPseudoElement)Creates the union from a CSSPseudoElement.
FromElement(Element)Creates the union from an Element.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(ElementOrCssPseudoElement)

CssPseudoElement.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ElementOrCssPseudoElement other)
Parameters
other ElementOrCssPseudoElement
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

CssPseudoElement.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

FromCssPseudoElement(CssPseudoElement)

CssPseudoElement.cs

Creates the union from a CSSPseudoElement.

public static ElementOrCssPseudoElement FromCssPseudoElement(CssPseudoElement value)

FromElement(Element)

CssPseudoElement.cs

Creates the union from an Element.

public static ElementOrCssPseudoElement FromElement(Element value)

Parameters

value Element

Returns

ElementOrCssPseudoElement

GetHashCode()

CssPseudoElement.cs

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

Operators

NameDescription
operator ==(ElementOrCssPseudoElement, ElementOrCssPseudoElement)Determines whether two unions are equal.
implicit operator ElementOrCssPseudoElement(CssPseudoElement)Converts a CSSPseudoElement to the union.
implicit operator ElementOrCssPseudoElement(Element)Converts an Element to the union.
operator !=(ElementOrCssPseudoElement, ElementOrCssPseudoElement)Determines whether two unions are different.

operator ==(ElementOrCssPseudoElement, ElementOrCssPseudoElement)

CssPseudoElement.cs

Determines whether two unions are equal.

public static bool operator ==(ElementOrCssPseudoElement left, ElementOrCssPseudoElement right)

op_Implicit overloads

implicit operator ElementOrCssPseudoElement(CssPseudoElement)

CssPseudoElement.cs

Converts a CSSPseudoElement to the union.

public static implicit operator ElementOrCssPseudoElement(CssPseudoElement value)

implicit operator ElementOrCssPseudoElement(Element)

CssPseudoElement.cs

Converts an Element to the union.

public static implicit operator ElementOrCssPseudoElement(Element value)
Parameters
value Element
Returns

ElementOrCssPseudoElement

operator !=(ElementOrCssPseudoElement, ElementOrCssPseudoElement)

CssPseudoElement.cs

Determines whether two unions are different.

public static bool operator !=(ElementOrCssPseudoElement left, ElementOrCssPseudoElement right)