Type.GenericTypeArguments 属性

定义

获取此类型泛型类型参数的数组。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. 若要获取当前 Type 对象的 TypeInfo 对象,请使用 IntrospectionExtensions.GetTypeInfo 扩展方法。To get a TypeInfo object for the current Type object, use the IntrospectionExtensions.GetTypeInfo extension method.

适用于