CssUnparsedSegment Struct

The CSSUnparsedSegment typedef: (USVString or CSSVariableReferenceValue) (https://drafts.css-houdini.org/css-typed-om-1/#typedefdef-cssunparsedsegment).

public readonly struct CssUnparsedSegment : IEquatable<CssUnparsedSegment>
Implements

Properties

NameDescription
StringValueGets the segment as a string, or null when it is a variable reference.
ValueGets the value: a String or a CssVariableReferenceValue.
VariableReferenceGets the segment as a variable reference, or null when it is a string.

Gets the segment as a string, or null when it is a variable reference.

public string? StringValue { get; }

Property value

string?

Gets the value: a String or a CssVariableReferenceValue.

public object Value { get; }

Property value

object

VariableReference

CssUnparsedValue.cs

Gets the segment as a variable reference, or null when it is a string.

public CssVariableReferenceValue? VariableReference { get; }

Methods

NameDescription
Equals(CssUnparsedSegment)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.
FromCssVariableReferenceValue(CssVariableReferenceValue)Creates a CssUnparsedSegment from a CssVariableReferenceValue.
FromString(string)Creates a CssUnparsedSegment from a string.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(CssUnparsedSegment)

CssUnparsedValue.cs

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

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

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

Equals(object?)

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

FromCssVariableReferenceValue(CssVariableReferenceValue)

CssUnparsedValue.cs

Creates a CssUnparsedSegment from a CssVariableReferenceValue.

public static CssUnparsedSegment FromCssVariableReferenceValue(CssVariableReferenceValue value)

FromString(string)

CssUnparsedValue.cs

Creates a CssUnparsedSegment from a string.

public static CssUnparsedSegment FromString(string value)

Parameters

value string

Returns

CssUnparsedSegment

GetHashCode()

CssUnparsedValue.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 ==(CssUnparsedSegment, CssUnparsedSegment)Determines whether two CssUnparsedSegment values are equal.
implicit operator CssUnparsedSegment(CssVariableReferenceValue)Converts a CssVariableReferenceValue to a CssUnparsedSegment.
implicit operator CssUnparsedSegment(string)Converts a string to a CssUnparsedSegment.
operator !=(CssUnparsedSegment, CssUnparsedSegment)Determines whether two CssUnparsedSegment values are not equal.

operator ==(CssUnparsedSegment, CssUnparsedSegment)

CssUnparsedValue.cs

Determines whether two CssUnparsedSegment values are equal.

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

Parameters

left CssUnparsedSegment
right CssUnparsedSegment

Returns

bool

op_Implicit overloads

implicit operator CssUnparsedSegment(CssVariableReferenceValue)

CssUnparsedValue.cs

Converts a CssVariableReferenceValue to a CssUnparsedSegment.

public static implicit operator CssUnparsedSegment(CssVariableReferenceValue value)

implicit operator CssUnparsedSegment(string)

CssUnparsedValue.cs

Converts a string to a CssUnparsedSegment.

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

CssUnparsedSegment

operator !=(CssUnparsedSegment, CssUnparsedSegment)

CssUnparsedValue.cs

Determines whether two CssUnparsedSegment values are not equal.

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

Parameters

left CssUnparsedSegment
right CssUnparsedSegment

Returns

bool