NamespaceConstraint Struct

The namespace constraint of a type or attribute selector (https://drafts.csswg.org/selectors-4/#type-nmsp).

public readonly struct NamespaceConstraint : IEquatable<NamespaceConstraint>
Implements

Properties

NameDescription
AnyAny namespace, including no namespace (*|E, or E without a default namespace).
KindGets the kind of the constraint.
NamespaceThe namespace when NamespaceConstraint.Kind is NamespaceConstraintKind.Specific, otherwise null.
NoneNo namespace (|E).

Any namespace, including no namespace (*|E, or E without a default namespace).

public static NamespaceConstraint Any { get; }

Property value

NamespaceConstraint

Gets the kind of the constraint.

public NamespaceConstraintKind Kind { get; }

Namespace

Selector.cs

The namespace when NamespaceConstraint.Kind is NamespaceConstraintKind.Specific, otherwise null.

public string? Namespace { get; }

Property value

string?

No namespace (|E).

public static NamespaceConstraint None { get; }

Property value

NamespaceConstraint

Methods

NameDescription
Equals(NamespaceConstraint)
Equals(object)
GetHashCode()
Matches(string?)Returns whether the namespace (null for no namespace) satisfies the constraint.
Specific(string)The namespace ns.
ToString()

Equals overloads

Equals(NamespaceConstraint)

public bool Equals(NamespaceConstraint other)
Parameters
other NamespaceConstraint
Returns

bool

No documentation is available.

Equals(object)

public override bool Equals(object obj)
Parameters
obj object
Returns

bool

No documentation is available.

GetHashCode()

public override int GetHashCode()

Returns

int

No documentation is available.

Matches(string?)

Selector.cs

Returns whether the namespace (null for no namespace) satisfies the constraint.

public bool Matches(string? ns)

Parameters

ns string?

Returns

bool

Specific(string)

Selector.cs

The namespace ns.

public static NamespaceConstraint Specific(string ns)

Parameters

ns string

Returns

NamespaceConstraint

ToString()

public override string ToString()

Returns

string

No documentation is available.

Operators

NameDescription
operator ==(NamespaceConstraint, NamespaceConstraint)
operator !=(NamespaceConstraint, NamespaceConstraint)

operator ==(NamespaceConstraint, NamespaceConstraint)

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

Parameters

left NamespaceConstraint
right NamespaceConstraint

Returns

bool

No documentation is available.

operator !=(NamespaceConstraint, NamespaceConstraint)

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

Parameters

left NamespaceConstraint
right NamespaceConstraint

Returns

bool

No documentation is available.