IList Interface

IList Interface

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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

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

No code example is currently available or this language may not be supported.

The IList type exposes the following members.

  NameDescription
Public propertyCountGets the number of elements contained in the ICollection. (Inherited from ICollection.)
Public propertyIsFixedSizeGets a value indicating whether the IList has a fixed size.
Public propertyIsReadOnlyGets a value indicating whether the IList is read-only.
Public propertyIsSynchronizedGets a value indicating whether access to the ICollection is synchronized (thread safe). (Inherited from ICollection.)
Public propertyItemGets or sets the element at the specified index.
Public propertySyncRootGets an object that can be used to synchronize access to the ICollection. (Inherited from ICollection.)
Top

  NameDescription
Public methodAddAdds an item to the IList.
Public methodClearRemoves all items from the IList.
Public methodContainsDetermines whether the IList contains a specific value.
Public methodCopyToCopies the elements of the ICollection to an Array, starting at a particular Array index. (Inherited from ICollection.)
Public methodGetEnumeratorReturns an enumerator that iterates through a collection. (Inherited from IEnumerable.)
Public methodIndexOfDetermines the index of a specific item in the IList.
Public methodInsertInserts an item to the IList at the specified index.
Public methodRemoveRemoves the first occurrence of a specific object from the IList.
Public methodRemoveAtRemoves the IList item at the specified index.
Top

  NameDescription
Public Extension MethodAsQueryableConverts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodCast<TResult>Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodOfType<TResult>Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Top

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.

For the generic version of this interface, see System.Collections.Generic::IList<T>.

The following example demonstrates the implementation of the IList interface to create a simple list, fixed-size list.

No code example is currently available or this language may not be supported.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft