TrustedHtmlOrString Struct

A value of the (TrustedHTML or DOMString) union type, the arguments of Document.Write.

public readonly struct TrustedHtmlOrString

Properties

NameDescription
StringValueGets the string value, or null when the union holds a trusted HTML value.
TrustedHtmlGets the trusted HTML value, or null when the union holds a string.

Gets the string value, or null when the union holds a trusted HTML value.

public string? StringValue { get; }

Property value

string?

Gets the trusted HTML value, or null when the union holds a string.

public TrustedHtml? TrustedHtml { get; }

Property value

TrustedHtml?

Methods

NameDescription
FromString(string)Creates the union from a string.
FromTrustedHtml(TrustedHtml)Creates the union from a trusted HTML value.

Creates the union from a string.

public static TrustedHtmlOrString FromString(string value)

Parameters

value string

Returns

TrustedHtmlOrString

FromTrustedHtml(TrustedHtml)

Document.DynamicMarkupInsertion.cs

Creates the union from a trusted HTML value.

public static TrustedHtmlOrString FromTrustedHtml(TrustedHtml value)

Parameters

value TrustedHtml

Returns

TrustedHtmlOrString

Operators

NameDescription
implicit operator TrustedHtmlOrString(TrustedHtml)Converts a trusted HTML value to the union type.
implicit operator TrustedHtmlOrString(string)Converts a string to the union type.

op_Implicit overloads

implicit operator TrustedHtmlOrString(TrustedHtml)

Document.DynamicMarkupInsertion.cs

Converts a trusted HTML value to the union type.

public static implicit operator TrustedHtmlOrString(TrustedHtml value)
Parameters
value TrustedHtml
Returns

TrustedHtmlOrString

implicit operator TrustedHtmlOrString(string)

Document.DynamicMarkupInsertion.cs

Converts a string to the union type.

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

TrustedHtmlOrString