DynamicMethod.GetCustomAttributes メソッド

定義

メソッドに適用されるカスタム属性を返します。

オーバーロード

GetCustomAttributes(Boolean)

メソッドの定義済みのカスタム属性をすべて返します。

GetCustomAttributes(Type, Boolean)

メソッドに適用されている、指定した型のカスタム属性を返します。

GetCustomAttributes(Boolean)

ソース:
DynamicMethod.cs
ソース:
DynamicMethod.cs
ソース:
DynamicMethod.cs

メソッドの定義済みのカスタム属性をすべて返します。

public:
 override cli::array <System::Object ^> ^ GetCustomAttributes(bool inherit);
public override object[] GetCustomAttributes (bool inherit);
override this.GetCustomAttributes : bool -> obj[]
Public Overrides Function GetCustomAttributes (inherit As Boolean) As Object()

パラメーター

inherit
Boolean

メソッドの継承チェーンを検索してカスタム属性を見つける場合は true、現在のメソッドだけを検査する場合は false

戻り値

Object[]

メソッドのすべてのカスタム属性を表す、オブジェクトの配列。

注釈

動的メソッドの場合、 メソッドが型で宣言されていないため、 に を指定trueinheritしても効果はありません。

注意

カスタム属性は現在、動的メソッドではサポートされていません。 返される属性は MethodImplAttributeのみです。メソッドを使用すると、メソッド実装フラグをより簡単に GetMethodImplementationFlags 取得できます。

こちらもご覧ください

適用対象

GetCustomAttributes(Type, Boolean)

ソース:
DynamicMethod.cs
ソース:
DynamicMethod.cs
ソース:
DynamicMethod.cs

メソッドに適用されている、指定した型のカスタム属性を返します。

public:
 override cli::array <System::Object ^> ^ GetCustomAttributes(Type ^ attributeType, bool inherit);
public override object[] GetCustomAttributes (Type attributeType, bool inherit);
override this.GetCustomAttributes : Type * bool -> obj[]
Public Overrides Function GetCustomAttributes (attributeType As Type, inherit As Boolean) As Object()

パラメーター

attributeType
Type

返されるカスタム属性の型を表す Type

inherit
Boolean

メソッドの継承チェーンを検索してカスタム属性を見つける場合は true、現在のメソッドだけを検査する場合は false

戻り値

Object[]

attributeType 型であるか、または attributeType 型から派生したメソッドの属性を表すオブジェクトの配列。

例外

attributeTypenullです。

注釈

動的メソッドの場合、 メソッドが型で宣言されていないため、 に を指定trueinheritしても効果はありません。

Note

カスタム属性は現在、動的メソッドではサポートされていません。 返される属性は MethodImplAttributeのみです。メソッドを使用すると、メソッド実装フラグをより簡単に GetMethodImplementationFlags 取得できます。

こちらもご覧ください

適用対象