MetadataBuilder.AddGenericParameter Метод

Определение

Добавляет определение универсального параметра.

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

Параметры

parent
EntityHandle

Дескриптор родительской сущности, который может быть либо элементом, TypeDefinitionHandle либо MethodDefinitionHandle.

attributes
GenericParameterAttributes

Атрибуты универсального параметра.

name
StringHandle

Имя параметра.

index
Int32

Отсчитываемый от нуля индекс параметров.

Возвращаемое значение

Дескриптор добавленного универсального параметра.

Исключения

parent не имеет ожидаемого типа дескриптора.

Комментарии

Универсальные параметры необходимо добавить в порядке, определяемом закодированный индекс родительской сущности (CodedIndex.TypeOrMethodDef(EntityHandle)).

Универсальные параметры с тем же родительским элементом должны быть упорядочены их index.

Применяется к