Returns an array of Type objects that represent the type arguments of a closed generic type or the type parameters of a generic type definition.
Assembly: mscorlib (in mscorlib.dll)
The invoked method is not supported in the base class. Derived classes must provide an implementation.
The array elements are returned in the order in which they appear in the list of type arguments for the generic type.
If the current type is a closed constructed type (that is, the ContainsGenericParameters property returns false), the array returned by the method contains the types that have been assigned to the generic type parameters of the generic type definition.
If the current type is a generic type definition, the array contains the type parameters.
If the current type is an open constructed type (that is, the ContainsGenericParameters property returns true) in which specific types have not been assigned to all of the type parameters and type parameters of enclosing generic types or methods, the array contains both types and type parameters. Use the IsGenericParameter property to tell them apart. For a demonstration of this scenario, see the code example for the ContainsGenericParameters property.
For a list of the invariant conditions for terms used in generic reflection, see the IsGenericType property remarks.
The following code example uses the method to display the type arguments of a constructed type and the type parameters of its generic type definition.
This code example is part of a larger example provided for the IsGenericTypeDefinition property. See the larger example for sample output.
.NET FrameworkSupported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
.NET Framework Client ProfileSupported in: 4, 3.5 SP1
XNA FrameworkSupported in: 3.0, 2.0, 1.0
Portable Class LibrarySupported in: Portable Class Library
Supported in: Windows Phone 8.1
Supported in: Windows Phone Silverlight 8.1
Supported in: Windows Phone Silverlight 8