Gets or sets an item in the list, by index.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic override sealed T this[
int index
] { get; set; }
public:
virtual property T default[int index] {
T get (int index) override sealed;
void set (int index, T value) override sealed;
}
Parameters
- index
- Type: SystemInt32
The index of the item to get or set. The first item in the list
has index 0, the last item has index Count-1.
Return Value
Type:
TThe value of the item at the given index.
Implements
IListTItemInt32
Exceptions
Remarks Gettingor setting an item takes time O(log N), where N is the number of items
in the list.
To process each of the items in the list, using GetEnumerator() or a foreach loop is more efficient
that accessing each of the elements by index.
See Also