CastArray2DTFrom, TToItem(Int32, Int32) Property

Gets or sets the element at the specified indices. Parameter order is the same as in case of a regular two-dimensional array.

Definition

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

Parameters

y  Int32
The Y-coordinate (row index) of the item to get or set.
x  Int32
The X-coordinate (column index) of the item to get or set.

Return Value

TTo
The element at the specified indices.

Remarks

Though this member does not validate the coordinates separately, it does not allow indexing beyond the Length of the underlying Buffer. To omit also the length check 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

IndexOutOfRangeExceptionThe specified indices refer to an item outside the bounds of the underlying Buffer.
NotSupportedException.NET Framework only: you access this member in a partially trusted AppDomain that does not allow executing unverifiable code.

See Also