public interface IList<T> : ICollection<T>, IEnumerable<T>, ICollection, IEnumerable
Represents a strongly typed list of objects that can be accessed by index. Provides methods for manipulating the list.
The IList<T> interface is the base interface for generic lists. It adds indexed access to the functionality provided by the ICollection<T> interface. Objects that implement IList<T> can be accessed by their zero-based index. The index is a numeric value that indicates the position of an element in the list.
The IList<T> interface includes methods for inserting, removing, and searching for elements. It also includes properties for getting the number of elements in the list and for getting or setting an element at a specific index.
All generic collections in the System.Collections.Generic namespace implement IList<T> if they support indexed access. For example, the List<T> class implements IList<T>.
T this[int index] { get; set; }
Indexer: Gets or sets the element at the specified index.
void Add(T item)
Add: Adds an object to the end of the IList<T>.
void Clear()
Clear: Removes all objects from the IList<T>.
bool Contains(T item)
Contains: Determines whether an element is in the IList<T>.
int IndexOf(T item)
IndexOf: Determines the index of the specified element in the IList<T>.
void Insert(int index, T item)
Insert: Inserts an item at the specified position.
void Remove(T item)
Remove: Removes the first occurrence of a specific object from the IList<T>.
void RemoveAt(int index)
RemoveAt: Removes the element at the specified index.
This interface inherits members from the following interfaces: