Otter SDK Reference
Version:

ClassCollection Class

Represents a collection of CSS classes on an element.

Inheritance Hierarchy

  • object
    • Inedo.Web.Controls.ClassCollection

Syntax

public class ClassCollection : IReadOnlyList<string>, IReadOnlyCollection<string>, IEnumerable<string>, System.Collections.IEnumerable, IList<string>, ICollection<string>

Constructors

Name Description
ClassCollection

Initializes a new instance of the ClassCollection class.

ClassCollection(string classes)

Initializes a new instance of the ClassCollection class.

ClassCollection(System.Collections.Generic.IEnumerable<string> classes)
ClassCollection(string[] classes)

Initializes a new instance of the ClassCollection class.

Properties

Name Description
Count

Gets the number of classes.

Item

Methods

Name Description
Add(string item)

Adds the class to the collection of it is not already present.

AddRange(System.Collections.Generic.IEnumerable<string> items)

Adds the classes to the collection if they are not already present.

Clear

Clears the class collection.

Contains(string item)

Returns a value indicating whether the specified class is present.

GetEnumerator

Returns the enumerator.

IndexOf(string item)

Returns the index of the specified class if it is present; otherwise -1.

Insert(int index, string item)

Inserts the class at the specified index.

Remove(string item)

Removes the specified class.

RemoveAt(int index)

Removes the class at the specified index.

ToString

Returns a space separated string of all of the classes.