MetadataBuilder.AddGenericParameter 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
新增了一個通用參數定義。
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
父實體的 handle 可以是 a TypeDefinitionHandle 或 MethodDefinitionHandle。
- attributes
- GenericParameterAttributes
通用參數屬性。
- name
- StringHandle
參數名稱。
- index
- Int32
零為基礎的參數索引。
傳回
一個附加通用參數的 handle。
例外狀況
parent 沒有預期中的握把類型。
index 大於 UInt16.MaxValue。
備註
通用參數必須依其父實體CodedIndex.TypeOrMethodDef(EntityHandle)的編碼索引()決定的順序加入。
具有相同父節點的泛型參數必須依其 index。