Language

MethodBuilder.SetCustomAttribute メソッド

定義

カスタム属性を設定します。

オーバーロード

名前 説明
SetCustomAttribute(CustomAttributeBuilder)

カスタム属性ビルダーを使用してカスタム属性を設定します。

SetCustomAttribute(ConstructorInfo, Byte[])

指定したカスタム属性 BLOB を使用してカスタム属性を設定します。

SetCustomAttribute(CustomAttributeBuilder)

ソース:
MethodBuilder.cs
ソース:
MethodBuilder.cs
ソース:
MethodBuilder.cs
ソース:
MethodBuilder.cs
ソース:
MethodBuilder.cs

カスタム属性ビルダーを使用してカスタム属性を設定します。

public:
 void SetCustomAttribute(System::Reflection::Emit::CustomAttributeBuilder ^ customBuilder);
public void SetCustomAttribute(System.Reflection.Emit.CustomAttributeBuilder customBuilder);
member this.SetCustomAttribute : System.Reflection.Emit.CustomAttributeBuilder -> unit
Public Sub SetCustomAttribute (customBuilder As CustomAttributeBuilder)

パラメーター

customBuilder
CustomAttributeBuilder

カスタム属性を記述するヘルパー クラスのインスタンス。

例外

customBuilder は nullです。

現在のメソッドの場合、 IsGenericMethod プロパティは trueされますが、 IsGenericMethodDefinition プロパティは false。

注釈

SetCustomAttribute メソッドは、2 つのメソッドを組み合わせて使用する場合に、SetImplementationFlags メソッドと対話できます。 詳細については、 SetImplementationFlags メソッドの「解説」セクションを参照してください。

適用対象

SetCustomAttribute(ConstructorInfo, Byte[])

ソース:
MethodBuilder.cs
ソース:
MethodBuilder.cs
ソース:
MethodBuilder.cs
ソース:
MethodBuilder.cs
ソース:
MethodBuilder.cs

指定したカスタム属性 BLOB を使用してカスタム属性を設定します。

public:
 void SetCustomAttribute(System::Reflection::ConstructorInfo ^ con, cli::array <System::Byte> ^ binaryAttribute);
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
[System.Runtime.InteropServices.ComVisible(true)]
public void SetCustomAttribute(System.Reflection.ConstructorInfo con, byte[] binaryAttribute);
member this.SetCustomAttribute : System.Reflection.ConstructorInfo * byte[] -> unit
[<System.Runtime.InteropServices.ComVisible(true)>]
member this.SetCustomAttribute : System.Reflection.ConstructorInfo * byte[] -> unit
Public Sub SetCustomAttribute (con As ConstructorInfo, binaryAttribute As Byte())

パラメーター

con
ConstructorInfo

カスタム属性のコンストラクター。

binaryAttribute
Byte[]

属性を表すバイト BLOB。

属性

例外

con または binaryAttribute が null。

現在のメソッドの場合、 IsGenericMethod プロパティは trueされますが、 IsGenericMethodDefinition プロパティは false。

注釈

binaryAttributeの書式を設定する方法については、共通言語インフラストラクチャ (CLI) 仕様のパーティション II のメタデータ仕様を参照してください。

SetCustomAttribute メソッドは、2 つのメソッドを組み合わせて使用する場合に、SetImplementationFlags メソッドと対話できます。 詳細については、 SetImplementationFlags メソッドの「解説」セクションを参照してください。

適用対象