Array2DTGetElementReferenceUnchecked Method

Gets the reference to the element at the specified coordinates, allowing them to point to any element in the UnderlyingArray of the Buffer property. To validate the coordinates against Length use the GetElementReference method instead. Parameter order is the same as in case of a regular two-dimensional array. This method does not perform any validation, so it can even throw a NullReferenceException if the IsNull property returns .

Definition

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

Parameters

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

  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 GetElementUnchecked/SetElementUnchecked methods instead.

Exceptions

IndexOutOfRangeExceptionThe specified indices refer to an invalid index in the actual underlying array.
VerificationException.NET Framework only: you execute this method in a partially trusted AppDomain that does not allow executing unverifiable code.
NullReferenceExceptionThe IsNull property returns .

See Also