Bewerken

Share via


MetadataBuilder.AddGenericParameter Method

Definition

Adds a generic parameter definition.

public:
 System::Reflection::Metadata::GenericParameterHandle AddGenericParameter(System::Reflection::Metadata::EntityHandle parent, System::Reflection::GenericParameterAttributes attributes, System::Reflection::Metadata::StringHandle name, int index);
public System.Reflection.Metadata.GenericParameterHandle AddGenericParameter (System.Reflection.Metadata.EntityHandle parent, System.Reflection.GenericParameterAttributes attributes, System.Reflection.Metadata.StringHandle name, int index);
member this.AddGenericParameter : System.Reflection.Metadata.EntityHandle * System.Reflection.GenericParameterAttributes * System.Reflection.Metadata.StringHandle * int -> System.Reflection.Metadata.GenericParameterHandle
Public Function AddGenericParameter (parent As EntityHandle, attributes As GenericParameterAttributes, name As StringHandle, index As Integer) As GenericParameterHandle

Parameters

parent
EntityHandle

The parent entity handle, which can be either a TypeDefinitionHandle or MethodDefinitionHandle.

attributes
GenericParameterAttributes

The generic parameter attributes.

name
StringHandle

The parameter name.

index
Int32

The zero-based parameter index.

Returns

A handle to the added generic parameter.

Exceptions

parent doesn't have the expected handle kind.

Remarks

Generic parameters must be added in an order determined by the coded index of their parent entity (CodedIndex.TypeOrMethodDef(EntityHandle)).

Generic parameters with the same parent must be ordered by their index.

Applies to