Struct ClassNameCollection
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
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
classNamestring
Returns
Contains(string)
Returns true if the collection contains the specified class name.
public readonly bool Contains(string className)
Parameters
classNamestring
Returns
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
classNamestring
Returns
Operators
operator +(ClassNameCollection, string)
public static ClassNameCollection operator +(ClassNameCollection collection, string className)
Parameters
collectionClassNameCollectionclassNamestring
Returns
operator -(ClassNameCollection, string)
public static ClassNameCollection operator -(ClassNameCollection collection, string className)
Parameters
collectionClassNameCollectionclassNamestring