RcssStyleDeclaration
Summary
Represents an element's inline RCSS style declarations, mirroring the DOM
Remarks
Danger
All calls made within this class MUST be performed on the Master Thread. See Threads.RunLater on how to safely call this from an asynchronous thread. Failure to comply with this can cause catastrophical failures as the engine is not designed for this.
Definition
Namespace: SDT4.Managed.UI.Rml
Assembly: SDT4.Managed.UI.dll
sealed class RcssStyleDeclaration
Inheritance:
Object ➔ DynamicObject ➔ RcssStyleDeclaration
Implements:
IDynamicMetaObjectProvider, IEnumerable<KeyValuePair<String, RmlVariant>>, IEnumerable
Fields
| Name | Type | Description |
|---|---|---|
Properties
| Name | Type | Description |
|---|---|---|
public get; set; Properties |
RmlVariant | Gets or sets an RCSS property value by its exact CSS property name (e.g., |
public get; LocalProperties |
KeyValuePair<String, RmlVariant>[] | Lists the local properties defined by this element. |
Methods
public RmlVariant GetProperty(String name)
Summary:
Retrieves the value of an RCSS property by its exact kebab-case name.
Corresponds to JavaScript
Parameters:
name(String): The CSS property name (e.g.,"background-color" ,"font-size" ).
Returns:
- RmlVariant: The value of the property as a variant, or an empty variant if the property is not set.
public Void SetProperty(String name, RmlVariant value)
Summary:
Sets the value of an RCSS property by its exact kebab-case name.
Corresponds to JavaScript
Parameters:
-
name(String): The CSS property name (e.g.,"background-color" ). -
value(RmlVariant): The style value to set.
public Void Remove(String name)
Summary:
Removes an RCSS property declaration from the element.
Corresponds to JavaScript
Parameters:
name(String): The CSS property name to remove (e.g.,"background-color" ).
public virtual Boolean TryGetMember(GetMemberBinder binder, out Object result)
Summary:
Provides dynamic member retrieval, mapping PascalCase or camelCase member access (e.g.,
Parameters:
-
binder(GetMemberBinder): Provides the dynamic member name. -
result(Object): Receives the resolved string style value.
Returns:
- Boolean:
always, resolving missing styles as empty strings.
public virtual Boolean TrySetMember(SetMemberBinder binder, Object? value)
Summary:
Provides dynamic member assignment, mapping PascalCase or camelCase member assignments (e.g.,
Parameters:
-
binder(SetMemberBinder): Provides the dynamic member name. -
value(Object?): The value to set, serialized via Object.ToString or set to an empty string if.
Returns:
- Boolean:
always.
public IEnumerator<KeyValuePair<String, RmlVariant>> GetEnumerator()
Returns:
public virtual String ToString()
Returns: