Array3DTGetElementReference Method

Gets the reference to the element at the specified indices. Parameter order is the same as in case of a regular three-dimensional array.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public ref T GetElementReference(
	int z,
	int y,
	int x
)

Parameters

z  Int32
The Z-coordinate (depth index) of the item to get the reference for.
y  Int32
The Y-coordinate (row index) of the item to get the reference for.
x  Int32
The X-coordinate (column index) of the item to get the reference for.

Return Value

T
The reference to the element at the specified coordinates.

Remarks

Though this method 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 the reference to any element in the whole UnderlyingArray, use the GetElementReferenceUnchecked method instead.

  Note

This method returns a value by reference. If this library is used by an older compiler that does not support such members, use the indexer instead.

Exceptions

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

See Also