SanitizerElement Struct

The SanitizerElement typedef: (DOMString or SanitizerElementNamespace).

public readonly struct SanitizerElement : IEquatable<SanitizerElement>
Implements

Properties

NameDescription
ElementNamespaceGets the value as an element name with its namespace, or null when the union holds another type.
NameGets the value as an element name, or null when the union holds another type.
ValueGets the value of the union: an element name or an element name with its namespace.

ElementNamespace

SanitizerTypes.cs

Gets the value as an element name with its namespace, or null when the union holds another type.

public SanitizerElementNamespace? ElementNamespace { get; }

Gets the value as an element name, or null when the union holds another type.

public string? Name { get; }

Property value

string?

Gets the value of the union: an element name or an element name with its namespace.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(SanitizerElement)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.
FromSanitizerElementNamespace(SanitizerElementNamespace)Creates the union from an element name with its namespace.
FromString(string)Creates the union from an element name.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(SanitizerElement)

SanitizerTypes.cs

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

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

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

Equals(object?)

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

FromSanitizerElementNamespace(SanitizerElementNamespace)

SanitizerTypes.cs

Creates the union from an element name with its namespace.

public static SanitizerElement FromSanitizerElementNamespace(SanitizerElementNamespace value)

FromString(string)

SanitizerTypes.cs

Creates the union from an element name.

public static SanitizerElement FromString(string value)

Parameters

value string

Returns

SanitizerElement

GetHashCode()

SanitizerTypes.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 ==(SanitizerElement, SanitizerElement)Determines whether two unions are equal.
implicit operator SanitizerElement(SanitizerElementNamespace)Converts an element name with its namespace to the union.
implicit operator SanitizerElement(string)Converts an element name to the union.
operator !=(SanitizerElement, SanitizerElement)Determines whether two unions are different.

operator ==(SanitizerElement, SanitizerElement)

SanitizerTypes.cs

Determines whether two unions are equal.

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

Parameters

left SanitizerElement
right SanitizerElement

Returns

bool

op_Implicit overloads

implicit operator SanitizerElement(SanitizerElementNamespace)

SanitizerTypes.cs

Converts an element name with its namespace to the union.

public static implicit operator SanitizerElement(SanitizerElementNamespace value)

implicit operator SanitizerElement(string)

SanitizerTypes.cs

Converts an element name to the union.

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

SanitizerElement

operator !=(SanitizerElement, SanitizerElement)

SanitizerTypes.cs

Determines whether two unions are different.

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

Parameters

left SanitizerElement
right SanitizerElement

Returns

bool