DomTokenList

Summary

Represents a set of space-separated tokens corresponding to an element's class attribute, mirroring the JavaScript DOM DOMTokenList interface (element.classList).

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

struct DomTokenList
Implements:


Fields

Name Type Description

Properties

Name Type Description

Methods

public Boolean Toggle(String className, Nullable<Boolean> force)

Summary: Adds or removes a class token depending on the specified boolean flag. Corresponds to JavaScript element.classList.toggle(className, force).

Parameters:

Returns:


public Void Remove(String className, String[] rest)

Summary: Removes one or more class tokens from the element. Corresponds to JavaScript element.classList.remove(...tokens).

Parameters:


public Void Remove(IEnumerable<String> list)

Summary: Removes a collection of class tokens from the element.

Parameters:


public Void Add(String className, String[] rest)

Summary: Adds one or more class tokens to the element. Corresponds to JavaScript element.classList.add(...tokens).

Parameters:


public Void Add(IEnumerable<String> list)

Summary: Adds a collection of class tokens to the element.

Parameters:


public Boolean Replace(String oldName, String newName)

Summary: Replaces an existing class token with a new class token. Corresponds to JavaScript element.classList.replace(oldToken, newToken).

Parameters:

Returns:


public Boolean Contains(String className)

Summary: Determines whether the element currently has the specified class token. Corresponds to JavaScript element.classList.contains(className).

Parameters:

Returns: