Table of Contents

Struct ClassNameCollection

Namespace
Xui.Core.UI
Assembly
Xui.Core.dll

A compact collection of CSS-like class name strings for a view. Stores up to 3 class names inline without allocation. If more are added, spills over into a HashSet<T>.

public struct ClassNameCollection : IEnumerable<string>, IEnumerable
Implements
Inherited Members

Properties

Count

Returns the number of class names in the collection.

public readonly int Count { get; }

Property Value

int

Methods

Add(string)

Adds a class name to the collection. Returns true if it was added (not already present).

public bool Add(string className)

Parameters

className string

Returns

bool

Contains(string)

Returns true if the collection contains the specified class name.

public readonly bool Contains(string className)

Parameters

className string

Returns

bool

GetEnumerator()

Returns an enumerator that iterates through the collection.

public readonly IEnumerator<string> GetEnumerator()

Returns

IEnumerator<string>

An enumerator that can be used to iterate through the collection.

Remove(string)

Removes a class name from the collection. Returns true if it was found and removed.

public bool Remove(string className)

Parameters

className string

Returns

bool

Operators

operator +(ClassNameCollection, string)

public static ClassNameCollection operator +(ClassNameCollection collection, string className)

Parameters

collection ClassNameCollection
className string

Returns

ClassNameCollection

operator -(ClassNameCollection, string)

public static ClassNameCollection operator -(ClassNameCollection collection, string className)

Parameters

collection ClassNameCollection
className string

Returns

ClassNameCollection