AddTypeParameter(string)
Appends a type parameter to the delegate.
Declaration
ITypeParameterBuilder AddTypeParameter(string name)Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the type parameter. |
Returns
| Type | Description |
|---|---|
| ITypeParameterBuilder | An ITypeParameterBuilder that allows you to complete the construction of the type parameter. |
Remarks
A delegate is, with an interface, one of the two kinds of type whose type parameters may declare variance, so Variance is meaningful on the value this method returns.
AddTypeParameter(ITypeParameter, bool)
Adds a type parameter that copies an existing type parameter: its name, its variance, its kind constraints and its type constraints.
Declaration
ITypeParameterBuilder AddTypeParameter(ITypeParameter prototype, bool includeCustomAttributes = false)Parameters
| Type | Name | Description |
|---|---|---|
| ITypeParameter | prototype | The type parameter to copy, typically a type parameter of another method or type. |
| bool | includeCustomAttributes | A value indicating whether the custom attributes of |
Returns
| Type | Description |
|---|---|
| ITypeParameterBuilder | An ITypeParameterBuilder that allows you to change the copy. |
Remarks
The builder records the copy. In the type constraints of the copy, and in the types of the type parameters and parameters that are
copied afterwards, a reference to prototype is replaced by a reference to the copy. Copy the type parameters
before the parameters that use them.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | A type parameter of the same name already exists. |