System.Reflection.Emit.TypeBuilder.DefineGenericParameters Method

Defines the generic type parameters for the current type, specifying their number and their names, and returns an array of System.Reflection.Emit.GenericTypeParameterBuilder objects that can be used to set their constraints.

Syntax

public GenericTypeParameterBuilder[] DefineGenericParameters (params string[] names)

Parameters

names
An array of names for the generic type parameters.

Returns

An array of System.Reflection.Emit.GenericTypeParameterBuilder objects that can be used to define the constraints of the generic type parameters for the current type.

Remarks

Calling this method makes the current type a generic type. If the method is called again on the same type, an InvalidOperationException is thrown.

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0