public interface IList : ICollection, IEnumerable
|
IsFixedSize | Read-only When implemented by a class, gets a value indicating whether the IList has a fixed size. |
IsReadOnly | Read-only When implemented by a class, gets a value indicating whether the IList is read-only. |
Item | Read-write When implemented by a class, gets or sets the element at the specified index. |
Add | When implemented by a class, adds an item to the IList. |
Clear | When implemented by a class, removes all items from the IList. |
Contains | When implemented by a class, determines whether the IList contains a specific value. |
IndexOf | When implemented by a class, determines the index of a specific item in the IList. |
Insert | When implemented by a class, inserts an item to the IList at the specified position. |
Remove | When implemented by a class, removes the first occurrence of a specific object from the IList. |
RemoveAt | When implemented by a class, removes the IList item at the specified index. |
Hierarchy:
bool IsFixedSize {get;}
|
bool IsReadOnly {get;}
|
object this[int index] {get; set;}
|
index
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | index is not a valid index in the IList. |
NotSupportedException | The property is set and the IList is read-only. |
myCollection[index]
.value
Exception Type | Condition |
---|---|
NotSupportedException | The IList is read-only. -or- The IList has a fixed size. |
void Clear(); |
Exception Type | Condition |
---|---|
NotSupportedException | The IList is read-only. |
value
value
index
value
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | index is not a valid index in the IList. |
NotSupportedException | The IList is read-only. -or- The IList has a fixed size. |
In collections of contiguous elements, such as lists, the elements that follow the insertion point move down to accomodate the new element. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hashtable.
void Remove( |
value
Exception Type | Condition |
---|---|
NotSupportedException | The IList is read-only. -or- The IList has a fixed size. |
void RemoveAt( |
index
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | index is not a valid index in the IList. |
NotSupportedException | The IList is read-only. -or- The IList has a fixed size. |