Table of Contents

Class ArrayIdentification

Namespace
Garyon.Functions.Arrays
Assembly
Garyon.dll

Provides functions useful for array identification, specifically regarding the element type.

public static class ArrayIdentification
Inheritance
ArrayIdentification
Inherited Members

Methods

IsArrayOfType<TElement>(Type)

Determines whether an array type contains elements of the provided type. It only checks for multidimensional arrays (of the form [(,)*]). Jagged arrays are not taken into consideration in this implementation.

public static bool IsArrayOfType<TElement>(Type arrayType)

Parameters

arrayType Type

The type of the array.

Returns

bool

Whether the given array type stores elements of the TElement type.

Type Parameters

TElement

The type of the element the array stores.

IsArrayOfType<TElement>(Type, int)

Determines whether an array type contains elements of the provided type. It also checks for jagged arrays up to a maximum jagging level.

public static bool IsArrayOfType<TElement>(Type arrayType, int maxJaggingLevel)

Parameters

arrayType Type

The type of the array.

maxJaggingLevel int

The maximum jagging level of the array (1 means up to [], 2 means up to [][], etc.).

Returns

bool

Whether the given array type stores elements of the TElement type.

Type Parameters

TElement

The type of the element the array stores.

IsArrayOfType<TArray, TElement>()

Determines whether an array type contains elements of the provided type. It only checks for multidimensional arrays (of the form [(,)*]). Jagged arrays are not taken into consideration in this implementation.

public static bool IsArrayOfType<TArray, TElement>()

Returns

bool

Whether the given array type stores elements of the TElement type.

Type Parameters

TArray

The type of the array.

TElement

The type of the element the array stores.

IsArrayOfType<TArray, TElement>(int)

Determines whether an array type contains elements of the provided type. It also checks for jagged arrays up to a maximum jagging level.

public static bool IsArrayOfType<TArray, TElement>(int maxJaggingLevel)

Parameters

maxJaggingLevel int

The maximum jagging level of the array (1 means up to [], 2 means up to [][], etc.).

Returns

bool

Whether the given array type stores elements of the TElement type.

Type Parameters

TArray

The type of the array.

TElement

The type of the element the array stores.