GenericTypeParameterBuilder.GetElementType GenericTypeParameterBuilder.GetElementType GenericTypeParameterBuilder.GetElementType GenericTypeParameterBuilder.GetElementType Method

定义

在所有情况下均引发 NotSupportedExceptionThrows a NotSupportedException in all cases.

public:
 override Type ^ GetElementType();
public override Type GetElementType ();
override this.GetElementType : unit -> Type
Public Overrides Function GetElementType () As Type

返回

当前数组类型、指针类型引用的类型,或者为 ByRef 类型;如果当前类型不为数组类型或指针类型,并且不由引用传递,则为 nullThe type referred to by the current array type, pointer type, or ByRef type; or null if the current type is not an array type, is not a pointer type, and is not passed by reference.

异常

注解

泛型类型参数是某个类型的占位符。A generic type parameter is a placeholder for a type. 由于无法提前知道该类型,因此无法确定它是否具有元素类型或该元素类型。Because that type cannot be known in advance, there is no way to know whether it has an element type or what that element type might be. 任何返回值都会产生误导,因此该方法会引发NotSupportedExceptionAny return value would be misleading, so the method throws a NotSupportedException.

适用于