SanitizerAttribute Struct

The SanitizerAttribute typedef: (DOMString or SanitizerAttributeNamespace).

public readonly struct SanitizerAttribute : IEquatable<SanitizerAttribute>
Implements

Properties

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

AttributeNamespace

SanitizerTypes.cs

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

public SanitizerAttributeNamespace? AttributeNamespace { get; }

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

public string? Name { get; }

Property value

string?

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

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(SanitizerAttribute)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.
FromSanitizerAttributeNamespace(SanitizerAttributeNamespace)Creates the union from an attribute name with its namespace.
FromString(string)Creates the union from an attribute name.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(SanitizerAttribute)

SanitizerTypes.cs

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

public bool Equals(SanitizerAttribute other)
Parameters
other SanitizerAttribute
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.

FromSanitizerAttributeNamespace(SanitizerAttributeNamespace)

SanitizerTypes.cs

Creates the union from an attribute name with its namespace.

public static SanitizerAttribute FromSanitizerAttributeNamespace(SanitizerAttributeNamespace value)

FromString(string)

SanitizerTypes.cs

Creates the union from an attribute name.

public static SanitizerAttribute FromString(string value)

Parameters

value string

Returns

SanitizerAttribute

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

operator ==(SanitizerAttribute, SanitizerAttribute)

SanitizerTypes.cs

Determines whether two unions are equal.

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

Parameters

left SanitizerAttribute
right SanitizerAttribute

Returns

bool

op_Implicit overloads

implicit operator SanitizerAttribute(SanitizerAttributeNamespace)

SanitizerTypes.cs

Converts an attribute name with its namespace to the union.

public static implicit operator SanitizerAttribute(SanitizerAttributeNamespace value)

implicit operator SanitizerAttribute(string)

SanitizerTypes.cs

Converts an attribute name to the union.

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

SanitizerAttribute

operator !=(SanitizerAttribute, SanitizerAttribute)

SanitizerTypes.cs

Determines whether two unions are different.

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

Parameters

left SanitizerAttribute
right SanitizerAttribute

Returns

bool