CastArray3DTFrom, TToGetElementReference 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 TTo 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

TTo
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 allow getting any item in the actual underlying array use then use the GetElementReferenceUnsafe 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