Type.GenericTypeArguments Type.GenericTypeArguments Type.GenericTypeArguments Type.GenericTypeArguments Property

定义

获取此类型泛型类型参数的数组。Gets an array of the generic type arguments for this type.

public:
 virtual property cli::array <Type ^> ^ GenericTypeArguments { cli::array <Type ^> ^ get(); };
public virtual Type[] GenericTypeArguments { get; }
member this.GenericTypeArguments : Type[]
Public Overridable ReadOnly Property GenericTypeArguments As Type()

属性值

Type[]

此类型的泛型类型参数的数组。An array of the generic type arguments for this type.

注解

此属性获取仅的泛型类型参数;也就是说,已为当前类型的泛型类型参数指定的类型。This property gets only the generic type arguments; that is, the types that have been specified for the generic type parameters of the current type. 如果当前类型是泛型类型定义,此属性将返回空数组。If the current type is a generic type definition, this property returns an empty array.

备注

如果泛型方法中或在另一个泛型类型中使用泛型类型,则其泛型类型参数的一些可能的封闭方法或类型的泛型类型参数。If a generic type is used in a generic method or in another generic type, some of its generic type arguments might be generic type parameters of the enclosing method or type.

若要获取表示泛型类型定义的类型的泛型类型参数,请使用TypeInfo.GenericTypeParameters属性。To get the generic type parameters of a type that represents a generic type definition, use the TypeInfo.GenericTypeParameters property. 若要获取TypeInfo对象的当前Type对象,请使用IntrospectionExtensions.GetTypeInfo扩展方法。To get a TypeInfo object for the current Type object, use the IntrospectionExtensions.GetTypeInfo extension method.

适用于