IList Interface
Represents a non-generic collection of objects that can be individually accessed by index.
Inheritance
- Object
- IEnumerable
- IList
Members
-
int Add(object value)Adds an element to the end of the IList.
-
void Clear()Removes all elements from the IList.
-
bool Contains(object value)Determines whether an element is in the IList.
-
int IndexOf(object value)Determines the index of a specific item in the IList.
-
void Insert(int index, object value)Inserts an element into the IList at the specified index.
- index
- The zero-based index at which value should be inserted.
- value
- The Object to insert into the IList. The value can be null for reference types.
-
void Remove(object value)Removes the first occurrence of a specific object from the IList.
-
void RemoveAt(int index)Removes the element at the specified index of the IList.
- index
- The zero-based index of the element to remove.
-
object this[int index] { get; set; }Gets or sets the element at the specified index.
- index
- The zero-based index of the element to get or set.
Remarks
The IList interface is the base interface for all non-generic list classes in the System.Collections namespace. It defines the basic operations for a list, such as adding, removing, and accessing elements by index. Many other collection classes, like ArrayList, implement this interface. For strongly-typed collections, consider using the generic System.Collections.Generic.IList<T> interface.