HtmlCollectionOrElement Struct

The (HTMLCollection or Element) union returned by the named getters of HtmlAllCollection.

public readonly struct HtmlCollectionOrElement : IEquatable<HtmlCollectionOrElement>
Implements

Properties

NameDescription
ElementGets the value as an element, or null when it is a collection.
HtmlCollectionGets the value as a collection, or null when it is an element.
ValueGets the value: an HtmlCollection or an Element.

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

public Element? Element { get; }

Property value

Element?

HtmlCollection

HtmlAllCollection.cs

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

public HtmlCollection? HtmlCollection { get; }

Property value

HtmlCollection?

Gets the value: an HtmlCollection or an Element.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(HtmlCollectionOrElement)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.
FromElement(Element)Creates a HtmlCollectionOrElement from a Element.
FromHtmlCollection(HtmlCollection)Creates a HtmlCollectionOrElement from a HtmlCollection.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(HtmlCollectionOrElement)

HtmlAllCollection.cs

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

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

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

Equals(object?)

HtmlAllCollection.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.

FromElement(Element)

HtmlAllCollection.cs

Creates a HtmlCollectionOrElement from a Element.

public static HtmlCollectionOrElement FromElement(Element value)

Parameters

value Element

Returns

HtmlCollectionOrElement

FromHtmlCollection(HtmlCollection)

HtmlAllCollection.cs

Creates a HtmlCollectionOrElement from a HtmlCollection.

public static HtmlCollectionOrElement FromHtmlCollection(HtmlCollection value)

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 ==(HtmlCollectionOrElement, HtmlCollectionOrElement)Determines whether two HtmlCollectionOrElement values are equal.
implicit operator HtmlCollectionOrElement(Element)Converts a Element to a HtmlCollectionOrElement.
implicit operator HtmlCollectionOrElement(HtmlCollection)Converts a HtmlCollection to a HtmlCollectionOrElement.
operator !=(HtmlCollectionOrElement, HtmlCollectionOrElement)Determines whether two HtmlCollectionOrElement values are not equal.

operator ==(HtmlCollectionOrElement, HtmlCollectionOrElement)

HtmlAllCollection.cs

Determines whether two HtmlCollectionOrElement values are equal.

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

op_Implicit overloads

implicit operator HtmlCollectionOrElement(Element)

HtmlAllCollection.cs

Converts a Element to a HtmlCollectionOrElement.

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

HtmlCollectionOrElement

implicit operator HtmlCollectionOrElement(HtmlCollection)

HtmlAllCollection.cs

Converts a HtmlCollection to a HtmlCollectionOrElement.

public static implicit operator HtmlCollectionOrElement(HtmlCollection value)

operator !=(HtmlCollectionOrElement, HtmlCollectionOrElement)

HtmlAllCollection.cs

Determines whether two HtmlCollectionOrElement values are not equal.

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