Interface IList
- Namespace
- System.Collections
- Assembly
- mscorlib.dll
Represents a non-generic collection of objects that can be individually accessed by index.
public interface IList : ICollection, IEnumerable
- Inherited Members
- Extension Methods
Properties
IsFixedSize
Gets a value indicating whether the IList has a fixed size.
bool IsFixedSize { get; }
Property Value
- bool
true if the IList has a fixed size; otherwise, false.
IsReadOnly
Gets a value indicating whether the IList is read-only.
bool IsReadOnly { get; }
Property Value
- bool
true if the IList is read-only; otherwise, false.
this[int]
Gets or sets the element at the specified index.
object this[int index] { get; set; }
Parameters
index
intThe zero-based index of the element to get or set.
Property Value
- object
The element at the specified index.
Methods
Add(object)
Adds an item to the IList.
int Add(object value)
Parameters
value
objectThe object to add to the IList.
Returns
- int
The position into which the new element was inserted, or -1 to indicate that the item was not inserted into the collection.
Clear()
Removes all items from the IList.
void Clear()
Contains(object)
Determines whether the IList contains a specific value.
bool Contains(object value)
Parameters
value
objectThe object to locate in the IList.
Returns
- bool
true if the Object is found in the IList; otherwise, false.
IndexOf(object)
Determines the index of a specific item in the IList.
int IndexOf(object value)
Parameters
value
objectThe object to locate in the IList.
Returns
- int
The index of value if found in the list; otherwise, -1.
Insert(int, object)
Inserts an item to the IList at the specified index.
void Insert(int index, object value)
Parameters
index
intThe zero-based index at which value should be inserted.
value
objectThe object to insert into the IList.
Remove(object)
Removes the first occurrence of a specific object from the IList.
void Remove(object value)
Parameters
value
objectThe object to remove from the IList.
RemoveAt(int)
Removes the IList item at the specified index.
void RemoveAt(int index)
Parameters
index
intThe zero-based index of the item to remove.