Class SAttribute
Definition
Namespace: StardewUI.Framework.Dom
Assembly: StardewUI.dll
Record implementation of a StarML IAttribute.
public record SAttribute : StardewUI.Framework.Dom.IAttribute,
IEquatable<StardewUI.Framework.Dom.SAttribute>
Inheritance
Object ⇦ SAttribute
Implements
IAttribute, IEquatable<SAttribute>
Remarks
Must be separate from the grammar's Attribute since ref struct
s currently are not allowed to implement interfaces.
Members
Constructors
Name | Description |
---|---|
SAttribute(string, string, AttributeType, AttributeValueType, Boolean, ContextRedirect) | Record implementation of a StarML IAttribute. |
SAttribute(Attribute) | Initializes a new SAttribute from the data of a parsed attribute. |
Properties
Name | Description |
---|---|
ContextRedirect | Specifies the redirect to use for a context binding, if applicable and if the ValueType is one of the context binding types. |
EqualityContract | |
IsNegated | Whether the attribute has a negation. Validity and behavior depend on the specific attribute. |
Name | The attribute name. |
Type | The type of the attribute itself, defining how the 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 |
---|---|
AsArgument() | Creates a method argument that will receive the same value as this attribute when bound. |
WithNameAndType(string, AttributeType) | Creates a copy of this attribute with a different Name and Type, and all other properties the same. |
Details
Constructors
SAttribute(string, string, AttributeType, AttributeValueType, bool, ContextRedirect)
Record implementation of a StarML IAttribute.
public SAttribute(string Name, string Value, StardewUI.Framework.Grammar.AttributeType Type, StardewUI.Framework.Grammar.AttributeValueType ValueType, bool IsNegated, StardewUI.Framework.Dom.ContextRedirect ContextRedirect);
Parameters
Name
string
The attribute name.
Value
string
The literal value text.
Type
AttributeType
The type of the attribute itself, defining how the Name
should be interpreted.
ValueType
AttributeValueType
The type of the value expression, defining how the Value
should be interpreted.
IsNegated
Boolean
Whether the attribute has a negation. Validity and behavior depend on the specific attribute.
ContextRedirect
ContextRedirect
Specifies the redirect to use for a context binding, if applicable and if the ValueType
is one of the context binding types.
Remarks
Must be separate from the grammar's Attribute since ref struct
s currently are not allowed to implement interfaces.
SAttribute(Attribute)
Initializes a new SAttribute from the data of a parsed attribute.
Parameters
attribute
Attribute
The parsed attribute.
Properties
ContextRedirect
Specifies the redirect to use for a context binding, if applicable and if the ValueType
is one of the context binding types.
Property Value
EqualityContract
Property Value
IsNegated
Whether the attribute has a negation. Validity and behavior depend on the specific attribute.
Property Value
Name
The attribute name.
Property Value
Type
The type of the attribute itself, defining how the Name
should be interpreted.
Property Value
Value
The literal value text.
Property Value
ValueType
The type of the value expression, defining how the Value
should be interpreted.
Property Value
Methods
AsArgument()
Creates a method argument that will receive the same value as this attribute when bound.
Returns
The converted argument.
WithNameAndType(string, AttributeType)
Creates a copy of this attribute with a different Name and Type, and all other properties the same.
public StardewUI.Framework.Dom.SAttribute WithNameAndType(string name, StardewUI.Framework.Grammar.AttributeType type);
Parameters
name
string
The new attribute name.
type
AttributeType
The new attribute type.
Returns
The renamed attribute.