RcssStyleDeclaration

Summary

Represents an element's inline RCSS style declarations, mirroring the DOM CSSStyleDeclaration interface. Supports direct property access, indexers, and dynamic PascalCase/camelCase to kebab-case resolution.

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., style["background-color"]).
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 element.style.getPropertyValue(name).

Parameters:

Returns:


public Void SetProperty(String name, RmlVariant value)

Summary: Sets the value of an RCSS property by its exact kebab-case name. Corresponds to JavaScript element.style.setProperty(name, value).

Parameters:


public Void Remove(String name)

Summary: Removes an RCSS property declaration from the element. Corresponds to JavaScript element.style.removeProperty(name).

Parameters:


public virtual Boolean TryGetMember(GetMemberBinder binder, out Object result)

Summary: Provides dynamic member retrieval, mapping PascalCase or camelCase member access (e.g., Style.BackgroundColor) to equivalent kebab-case RCSS property names (e.g., "background-color").

Parameters:

Returns:


public virtual Boolean TrySetMember(SetMemberBinder binder, Object? value)

Summary: Provides dynamic member assignment, mapping PascalCase or camelCase member assignments (e.g., Style.BackgroundColor = "red") to equivalent kebab-case RCSS property names (e.g., "background-color").

Parameters:

Returns:


public IEnumerator<KeyValuePair<String, RmlVariant>> GetEnumerator()

Returns:


public virtual String ToString()

Returns: