語言

MetadataBuilder.AddCustomAttribute 方法

定義

新增一個自訂屬性。

public:
 System::Reflection::Metadata::CustomAttributeHandle AddCustomAttribute(System::Reflection::Metadata::EntityHandle parent, System::Reflection::Metadata::EntityHandle constructor, System::Reflection::Metadata::BlobHandle value);
public System.Reflection.Metadata.CustomAttributeHandle AddCustomAttribute(System.Reflection.Metadata.EntityHandle parent, System.Reflection.Metadata.EntityHandle constructor, System.Reflection.Metadata.BlobHandle value);
member this.AddCustomAttribute : System.Reflection.Metadata.EntityHandle * System.Reflection.Metadata.EntityHandle * System.Reflection.Metadata.BlobHandle -> System.Reflection.Metadata.CustomAttributeHandle
Public Function AddCustomAttribute (parent As EntityHandle, constructor As EntityHandle, value As BlobHandle) As CustomAttributeHandle

參數

constructor
EntityHandle

自訂屬性建構子:a MethodDefinitionHandle 或 MemberReferenceHandle。

value
BlobHandle

一個自訂屬性值的 blob。

傳回

新增自訂屬性的帳柄。

例外狀況

parent 沒有預期中的握把類型。

備註

條目可依任意順序添加。 序列化時,表格會自動排序。

適用於