TypeBuilder.GetGenericArguments 方法

定义

返回一个 Type 对象的数组,表示泛型类型的类型变量或泛型类型定义的类型参数。Returns an array of Type objects representing the type arguments of a generic type or the type parameters of a generic type definition.

public:
 override cli::array <Type ^> ^ GetGenericArguments();
public override Type[] GetGenericArguments ();
override this.GetGenericArguments : unit -> Type[]
Public Overrides Function GetGenericArguments () As Type()

返回

Type[]

一个 Type 对象数组。An array of Type objects. 此数组的元素表示泛型类型的类型参数或泛型类型定义的类型参数。The elements of the array represent the type arguments of a generic type or the type parameters of a generic type definition.

注解

返回数组的元素按它们出现在泛型类型定义的类型参数列表中的顺序排列。The elements of the returned array are in the order in which they appear in the list of type parameters for the generic type definition.

TypeBuilder如果 DefineGenericParameters 使用方法为其提供泛型类型参数,则对象表示泛型类型定义。A TypeBuilder object represents a generic type definition if the DefineGenericParameters method has been used to give it generic type parameters. 此方法检索 GenericTypeParameterBuilder 表示泛型类型参数的对象。This method retrieves the GenericTypeParameterBuilder objects that represent the generic type parameters.

若要详细了解反射中的泛型类型和泛型反射中使用的术语的固定条件列表,请参见 Type.IsGenericType 属性。For more information on generic types in reflection and a list of the invariant conditions for terms used in generic reflection, see the Type.IsGenericType property.

适用于

另请参阅