Class ArrayIdentification
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
arrayTypeTypeThe type of the array.
Returns
- bool
Whether the given array type stores elements of the
TElementtype.
Type Parameters
TElementThe 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
arrayTypeTypeThe type of the array.
maxJaggingLevelintThe 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
TElementtype.
Type Parameters
TElementThe 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
TElementtype.
Type Parameters
TArrayThe type of the array.
TElementThe 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
maxJaggingLevelintThe 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
TElementtype.
Type Parameters
TArrayThe type of the array.
TElementThe type of the element the array stores.