Class DOMTokenList

Class DOMTokenList

Namespace: Aspose.Html.Collections
Assembly: Aspose.HTML.dll (25.2.0)

The DOMTokenList class represents a set of space-separated tokens. It is indexed beginning with 0 as with JavaScript Array objects. DOMTokenList is always case-sensitive.

[DOMName("DOMTokenList")]
[ComVisible(true)]
[DOMObject]
public class DOMTokenList : DOMObject, INotifyPropertyChanged, IEnumerable<string>, IEnumerable

Inheritance

objectDOMObjectDOMTokenList

Implements

INotifyPropertyChanged, IEnumerable<string>, IEnumerable

Inherited Members

DOMObject.GetPlatformType(), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties

Length

Returns an ulong which represents the number of tokens stored in this list.

[DOMName("length")]
public uint Length { get; }

Property Value

uint

Value

Gets or sets the value of a corresponding attribute.

[DOMName("value")]
public string Value { get; set; }

Property Value

string

this[uint]

Returns the item in the list by its index, or null if index is greater than or equal to the list’s length.

[DOMName("item")]
public string this[uint index] { get; }

Property Value

string

Methods

Add(params string[])

Adds the specified token(s) to the list.

[DOMName("add")]
public void Add(params string[] tokens)

Parameters

tokens string[]

Representing the token (or tokens) to add to the tokenList.

Contains(string)

Returns true if the list contains the given token, otherwise false.

[DOMName("contains")]
public bool Contains(string token)

Parameters

token string

The token to locate in the list.

Returns

bool

A Boolean, which is true if the calling list contains token, otherwise false.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<string> GetEnumerator()

Returns

IEnumerator<string&gt;

An System.Collections.Generic.IEnumerator`1 object that can be used to iterate through the collection.

Remove(params string[])

Removes the specified token(s) from the list.

[DOMName("remove")]
public void Remove(params string[] tokens)

Parameters

tokens string[]

Represents the token(s) you want to remove from the list.

Replace(string, string)

Replaces an existing token with a new token. Does nothing if the first token doesn’t exist.

[DOMName("replace")]
public bool Replace(string token, string newToken)

Parameters

token string

The token you want to replace.

newToken string

The token you want to replace the old token with.

Returns

bool

Boolean true if the token was found and replaced, false otherwise.

Supports(string)

Returns true if a given token is in the associated attribute’s supported tokens.

[DOMName("supports")]
public bool Supports(string token)

Parameters

token string

The token to query for.

Returns

bool

A Boolean indicating whether the token was found.

Toggle(string)

Removes the token from the list if it exists, or adds the token to the list if it doesn’t.

[DOMName("toggle")]
public bool Toggle(string token)

Parameters

token string

The token you want to toggle.

Returns

bool

A Boolean indicating whether token is in the list after the call.

Toggle(string, bool)

Removes the token from the list if it exists, or adds the token to the list if it doesn’t.

[DOMName("toggle")]
public bool Toggle(string token, bool force)

Parameters

token string

The token you want to toggle.

force bool

A Boolean that, if included, turns the toggle into a one way-only operation. If set to false, then token will only be removed, but not added. If set to true, then token will only be added, but not removed.

Returns

bool

A Boolean indicating whether token is in the list after the call. </string>