Skip to content

Struct Attribute

Definition

Namespace: StardewUI.Framework.Grammar
Assembly: StardewUI.dll

A complete attribute assignment parsed from StarML.

[System.Obsolete]
public readonly ref struct Attribute

Inheritance
ObjectValueType ⇦ Attribute

Members

Constructors

Name Description
Attribute(ReadOnlySpan<Char>, AttributeType, Boolean, AttributeValueType, ReadOnlySpan<Char>, UInt32, ReadOnlySpan<Char>) A complete attribute assignment parsed from StarML.

Properties

Name Description
IsNegated Whether the attribute has a negation (!) operator before assignment.
Name The attribute name.
ParentDepth The depth to walk - i.e. number of parents to traverse - to find the context on which to evaluate a context binding. Exclusive with ParentType and only valid if the ValueType is a type that matches IsContextBinding(AttributeValueType).
ParentType The type name of the parent to walk up to for a context redirect. Exclusive with ParentDepth and only valid if the ValueType is a type that matches IsContextBinding(AttributeValueType).
Type The type of the attribute itself, i.e. how its Name should be interpreted.
Value The literal value text.
ValueType The type of the value expression, defining how the Value should be interpreted.

Methods

Name Description
Equals(Object) (Inherited from ValueType)
GetHashCode() (Inherited from ValueType)
ToString() (Inherited from ValueType)

Details

Constructors

Attribute(ReadOnlySpan<Char>, AttributeType, bool, AttributeValueType, ReadOnlySpan<Char>, uint, ReadOnlySpan<Char>)

A complete attribute assignment parsed from StarML.

public Attribute(ReadOnlySpan<System.Char> name, StardewUI.Framework.Grammar.AttributeType type, bool isNegated, StardewUI.Framework.Grammar.AttributeValueType valueType, ReadOnlySpan<System.Char> value, uint parentDepth, ReadOnlySpan<System.Char> parentType);
Parameters

name   ReadOnlySpan<Char>
The attribute name.

type   AttributeType
The type of the attribute itself, i.e. how its name should be interpreted.

isNegated   Boolean
Whether the attribute has a negation (!) operator before assignment.

valueType   AttributeValueType
The type of the value expression, defining how the value should be interpreted.

value   ReadOnlySpan<Char>
The literal value text.

parentDepth   UInt32
The depth to walk - i.e. number of parents to traverse - to find the context on which to evaluate a context binding. Only valid if the valueType is a type that matches IsContextBinding(AttributeValueType).

parentType   ReadOnlySpan<Char>
The type name of the parent to search for, to find the the context on which to evaluate a context binding. Exclusive with parentDepth and only valid if the valueType is a type that matches IsContextBinding(AttributeValueType).


Properties

IsNegated

Whether the attribute has a negation (!) operator before assignment.

public bool IsNegated { get; }
Property Value

Boolean

Remarks

Negation behavior is specific to the exact attribute and is not supported for many/most attributes.


Name

The attribute name.

public ReadOnlySpan<System.Char> Name { get; }
Property Value

ReadOnlySpan<Char>


ParentDepth

The depth to walk - i.e. number of parents to traverse - to find the context on which to evaluate a context binding. Exclusive with ParentType and only valid if the ValueType is a type that matches IsContextBinding(AttributeValueType).

public uint ParentDepth { get; }
Property Value

UInt32


ParentType

The type name of the parent to walk up to for a context redirect. Exclusive with ParentDepth and only valid if the ValueType is a type that matches IsContextBinding(AttributeValueType).

public ReadOnlySpan<System.Char> ParentType { get; }
Property Value

ReadOnlySpan<Char>


Type

The type of the attribute itself, i.e. how its Name should be interpreted.

public StardewUI.Framework.Grammar.AttributeType Type { get; }
Property Value

AttributeType


Value

The literal value text.

public ReadOnlySpan<System.Char> Value { get; }
Property Value

ReadOnlySpan<Char>


ValueType

The type of the value expression, defining how the Value should be interpreted.

public StardewUI.Framework.Grammar.AttributeValueType ValueType { get; }
Property Value

AttributeValueType