CastArrayTFrom, TToItem Property

Gets or sets the element at the specified index.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public TTo this[
	int index
] { get; set; }

Parameters

index  Int32
The zero-based index of the element to get or set.

Return Value

TTo
The element at the specified index.

Implements

IListTItemInt32
IReadOnlyListTItemInt32

Remarks

This member validates index against Length. To allow getting/setting any item in the actual underlying array use the GetElementUnsafe/SetElementUnsafe methods instead.

If the compiler you use supports members that return a value by reference, you can also use the GetElementReference method.

Exceptions

IndexOutOfRangeExceptionindex is less than zero or greater or equal to Length.
NotSupportedException.NET Framework only: you access this member in a partially trusted AppDomain that does not allow executing unverifiable code.

See Also