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 over all class names in the collection.
public readonly IEnumerator<string> GetEnumerator()
Returns
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)
Adds a class name to the collection and returns the updated collection.
public static ClassNameCollection operator +(ClassNameCollection collection, string className)
Parameters
collectionClassNameCollectionclassNamestring
Returns
operator -(ClassNameCollection, string)
Removes a class name from the collection and returns the updated collection.
public static ClassNameCollection operator -(ClassNameCollection collection, string className)
Parameters
collectionClassNameCollectionclassNamestring