Array2DTItem(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: 9.0.0
C#
public T 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

T
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, allowing to get/set any element in the whole UnderlyingArray, use the GetElementUnchecked/SetElementUnchecked 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.

See Also