NodeOrString Struct

The (Node or DOMString) union used by the ParentNode and ChildNode mixins.

public readonly struct NodeOrString

Properties

NameDescription
NodeGets the node, or null when the value is a string.
StringValueGets the string, or null when the value is a node.

Gets the node, or null when the value is a string.

public Node? Node { get; }

Property value

Node?

StringValue

Mixins.cs

Gets the string, or null when the value is a node.

public string? StringValue { get; }

Property value

string?

Methods

NameDescription
FromNode(Node)Creates a union value holding the given node.
FromString(string)Creates a union value holding the given string.

FromNode(Node)

Mixins.cs

Creates a union value holding the given node.

public static NodeOrString FromNode(Node node)

Parameters

node Node

Returns

NodeOrString

FromString(string)

Mixins.cs

Creates a union value holding the given string.

public static NodeOrString FromString(string value)

Parameters

value string

Returns

NodeOrString

Operators

NameDescription
implicit operator NodeOrString(Node)Converts a node to a union value.
implicit operator NodeOrString(string)Converts a string to a union value.

op_Implicit overloads

implicit operator NodeOrString(Node)

Mixins.cs

Converts a node to a union value.

public static implicit operator NodeOrString(Node node)
Parameters
node Node
Returns

NodeOrString

implicit operator NodeOrString(string)

Mixins.cs

Converts a string to a union value.

public static implicit operator NodeOrString(string value)
Parameters
value string
Returns

NodeOrString