次の方法で共有


_Type.GetCustomAttributes メソッド

定義

COM オブジェクトに、GetCustomAttributes メソッドへのバージョンに依存しないアクセスが用意されています。

オーバーロード

名前 説明
GetCustomAttributes(Boolean)

COM オブジェクトに、GetCustomAttributes(Boolean) メソッドへのバージョンに依存しないアクセスが用意されています。

GetCustomAttributes(Type, Boolean)

COM オブジェクトに、GetCustomAttributes(Type, Boolean) メソッドへのバージョンに依存しないアクセスが用意されています。

注釈

このメソッドは、アンマネージ コードからマネージド クラスにアクセスするためのメソッドであり、マネージド コードから呼び出さないでください。

メソッドは MemberInfo.GetCustomAttributes 、このメンバーに適用されたすべての属性を返します。

GetCustomAttributes(Boolean)

COM オブジェクトに、GetCustomAttributes(Boolean) メソッドへのバージョンに依存しないアクセスが用意されています。

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

パラメーター

inherit
Boolean

このメンバーの継承チェーンを検索して属性を見つけるかどうかを指定します。

戻り値

Object[]

このメンバーに適用されているカスタム属性の配列。適用されている属性がない場合は、要素がゼロ (0) の配列。

注釈

このメソッドは、アンマネージ コードからマネージド クラスにアクセスするためのメソッドであり、マネージド コードから呼び出さないでください。

メソッドは Assembly.GetCustomAttributes 、このメンバーに適用されたすべての属性を返します。

適用対象

GetCustomAttributes(Type, Boolean)

COM オブジェクトに、GetCustomAttributes(Type, Boolean) メソッドへのバージョンに依存しないアクセスが用意されています。

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

パラメーター

attributeType
Type

検索する属性の種類。 この型に代入可能な属性だけが返されます。

inherit
Boolean

このメンバーの継承チェーンを検索して属性を見つけるかどうかを指定します。

戻り値

Object[]

このメンバーに適用されているカスタム属性の配列。適用されている属性がない場合は、要素がゼロ (0) の配列。

注釈

このメソッドは、アンマネージ コードからマネージド クラスにアクセスするためのメソッドであり、マネージド コードから呼び出さないでください。

メソッドは MemberInfo.GetCustomAttributes 、このメンバーに適用されたすべての属性を返します。

適用対象