Share via


IList Interface

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a non-generic collection of objects that can be individually accessed by index.

Namespace:  System.Collections
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Interface IList _
    Inherits ICollection, IEnumerable
public interface IList : ICollection, IEnumerable
public interface class IList : ICollection, 
    IEnumerable
type IList =  
    interface
        interface ICollection
        interface IEnumerable
    end
public interface IList extends ICollection, IEnumerable

The IList type exposes the following members.

Properties

  Name Description
Public property Count Gets the number of elements contained in the ICollection. (Inherited from ICollection.)
Public property IsFixedSize Gets a value indicating whether the IList has a fixed size.
Public property IsReadOnly Gets a value indicating whether the IList is read-only.
Public property IsSynchronized Gets a value indicating whether access to the ICollection is synchronized (thread safe). (Inherited from ICollection.)
Public property Item Gets or sets the element at the specified index.
Public property SyncRoot Gets an object that can be used to synchronize access to the ICollection. (Inherited from ICollection.)

Top

Methods

  Name Description
Public method Add Adds an item to the IList.
Public method Clear Removes all items from the IList.
Public method Contains Determines whether the IList contains a specific value.
Public method CopyTo Copies the elements of the ICollection to an Array, starting at a particular Array index. (Inherited from ICollection.)
Public method GetEnumerator Returns an enumerator that iterates through a collection. (Inherited from IEnumerable.)
Public method IndexOf Determines the index of a specific item in the IList.
Public method Insert Inserts an item to the IList at the specified index.
Public method Remove Removes the first occurrence of a specific object from the IList.
Public method RemoveAt Removes the IList item at the specified index.

Top

Remarks

IList is a descendant of the ICollection interface and is the base interface of all non-generic lists. IList implementations fall into three categories: read-only, fixed-size, and variable-size. A read-only IList cannot be modified. A fixed-size IList does not allow the addition or removal of elements, but it allows the modification of existing elements. A variable-size IList allows the addition, removal, and modification of elements.

See Also

Reference

System.Collections Namespace