CastArray3DTFrom, TToGetElementReferenceUnsafe Method

Gets the reference to the element at the specified coordinates without any range check or validation. This method can even throw a NullReferenceException if the IsNull property returns . To validate the coordinates against Length use the GetElementReference method instead. 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#
[SecurityCriticalAttribute]
public ref TTo GetElementReferenceUnsafe(
	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

  Caution

You must ensure that the specified indices designate an element in the bounds of the actual underlying array. Attempting to access protected memory may crash the runtime.

  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 GetElementUnsafe/SetElementUnsafe methods instead.

Exceptions

VerificationException.NET Framework only: you execute this method in a partially trusted AppDomain that does not allow executing unverifiable code.
NullReferenceExceptionIsNull is .

See Also