CustomAttributeExtensions.GetCustomAttributes メソッド

定義

指定された要素に適用されるカスタム属性のコレクションを取得します。

オーバーロード

GetCustomAttributes(ParameterInfo, Type, Boolean)

指定されたパラメーターに適用される指定された型のカスタム属性のコレクションを取得し、オプションでそのパラメーターの先祖を調べます。

GetCustomAttributes(MemberInfo, Type, Boolean)

指定されたメンバーに適用されている指定された型のカスタム属性のコレクションを取得し、オプションでそのメンバーの先祖を調べます。

GetCustomAttributes(ParameterInfo, Type)

指定されたパラメーターに適用される指定された型のカスタム属性のコレクションを取得します。

GetCustomAttributes(ParameterInfo, Boolean)

指定されたパラメーターに適用されるカスタム属性のコレクションを取得し、オプションでそのパラメーターの先祖を調べます。

GetCustomAttributes(Module, Type)

指定されたモジュールに適用される指定された型のカスタム属性のコレクションを取得します。

GetCustomAttributes(MemberInfo, Type)

指定されたメンバーに適用される指定された型のカスタム属性のコレクションを取得します。

GetCustomAttributes(MemberInfo, Boolean)

指定されたメンバーに適用されるカスタム属性のコレクションを取得し、オプションでそのメンバーの先祖を調べます。

GetCustomAttributes(Assembly, Type)

指定されたアセンブリに適用されている、指定された型のカスタム属性のコレクションを取得します。

GetCustomAttributes(ParameterInfo)

指定されたパラメーターに適用されるカスタム属性のコレクションを取得します。

GetCustomAttributes(Module)

指定されたモジュールに適用されるカスタム属性のコレクションを取得します。

GetCustomAttributes(MemberInfo)

指定されたメンバーに適用されるカスタム属性のコレクションを取得します。

GetCustomAttributes(Assembly)

指定されたアセンブリに適用されるカスタム属性のコレクションを取得します。

GetCustomAttributes<T>(ParameterInfo, Boolean)

指定されたパラメーターに適用される指定された型のカスタム属性のコレクションを取得し、オプションでそのパラメーターの先祖を調べます。

GetCustomAttributes<T>(MemberInfo, Boolean)

指定されたメンバーに適用されている指定された型のカスタム属性のコレクションを取得し、オプションでそのメンバーの先祖を調べます。

GetCustomAttributes<T>(ParameterInfo)

指定されたパラメーターに適用される指定された型のカスタム属性のコレクションを取得します。

GetCustomAttributes<T>(MemberInfo)

指定されたメンバーに適用される指定された型のカスタム属性のコレクションを取得します。

GetCustomAttributes<T>(Assembly)

指定されたアセンブリに適用されている、指定された型のカスタム属性のコレクションを取得します。

GetCustomAttributes<T>(Module)

指定されたモジュールに適用される指定された型のカスタム属性のコレクションを取得します。

GetCustomAttributes(ParameterInfo, Type, Boolean)

指定されたパラメーターに適用される指定された型のカスタム属性のコレクションを取得し、オプションでそのパラメーターの先祖を調べます。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, Type ^ attributeType, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element, Type attributeType, bool inherit);
static member GetCustomAttributes : System.Reflection.ParameterInfo * Type * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo, attributeType As Type, inherit As Boolean) As IEnumerable(Of Attribute)

パラメーター

element
ParameterInfo

調べるパラメーター。

attributeType
Type

検索する属性の種類。

inherit
Boolean

element の先祖を調べる場合は true。それ以外の場合は false

戻り値

IEnumerable<Attribute>

element に適用され、attributeType に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

element または attributeTypenull です。

attributeTypeAttribute から派生していません。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes(MemberInfo, Type, Boolean)

指定されたメンバーに適用されている指定された型のカスタム属性のコレクションを取得し、オプションでそのメンバーの先祖を調べます。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, Type ^ attributeType, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element, Type attributeType, bool inherit);
static member GetCustomAttributes : System.Reflection.MemberInfo * Type * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo, attributeType As Type, inherit As Boolean) As IEnumerable(Of Attribute)

パラメーター

element
MemberInfo

調べるメンバー。

attributeType
Type

検索する属性の種類。

inherit
Boolean

element の先祖を調べる場合は true。それ以外の場合は false

戻り値

IEnumerable<Attribute>

element に適用され、attributeType に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

element または attributeTypenull です。

attributeTypeAttribute から派生していません。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes(ParameterInfo, Type)

指定されたパラメーターに適用される指定された型のカスタム属性のコレクションを取得します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element, Type attributeType);
static member GetCustomAttributes : System.Reflection.ParameterInfo * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo, attributeType As Type) As IEnumerable(Of Attribute)

パラメーター

element
ParameterInfo

調べるパラメーター。

attributeType
Type

検索する属性の種類。

戻り値

IEnumerable<Attribute>

element に適用され、attributeType に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

element または attributeTypenull です。

attributeTypeAttribute から派生していません。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes(ParameterInfo, Boolean)

指定されたパラメーターに適用されるカスタム属性のコレクションを取得し、オプションでそのパラメーターの先祖を調べます。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element, bool inherit);
static member GetCustomAttributes : System.Reflection.ParameterInfo * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo, inherit As Boolean) As IEnumerable(Of Attribute)

パラメーター

element
ParameterInfo

調べるパラメーター。

inherit
Boolean

element の先祖を調べる場合は true。それ以外の場合は false

戻り値

IEnumerable<Attribute>

element に適用されるカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes(Module, Type)

指定されたモジュールに適用される指定された型のカスタム属性のコレクションを取得します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Module ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Module element, Type attributeType);
static member GetCustomAttributes : System.Reflection.Module * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Module, attributeType As Type) As IEnumerable(Of Attribute)

パラメーター

element
Module

調べるモジュール。

attributeType
Type

検索する属性の種類。

戻り値

IEnumerable<Attribute>

element に適用され、attributeType に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

element または attributeTypenull です。

attributeTypeAttribute から派生していません。

適用対象

GetCustomAttributes(MemberInfo, Type)

指定されたメンバーに適用される指定された型のカスタム属性のコレクションを取得します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element, Type attributeType);
static member GetCustomAttributes : System.Reflection.MemberInfo * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo, attributeType As Type) As IEnumerable(Of Attribute)

パラメーター

element
MemberInfo

調べるメンバー。

attributeType
Type

検索する属性の種類。

戻り値

IEnumerable<Attribute>

element に適用され、attributeType に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

element または attributeTypenull です。

attributeTypeAttribute から派生していません。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes(MemberInfo, Boolean)

指定されたメンバーに適用されるカスタム属性のコレクションを取得し、オプションでそのメンバーの先祖を調べます。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element, bool inherit);
static member GetCustomAttributes : System.Reflection.MemberInfo * bool -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo, inherit As Boolean) As IEnumerable(Of Attribute)

パラメーター

element
MemberInfo

調べるメンバー。

inherit
Boolean

element の先祖を調べる場合は true。それ以外の場合は false

戻り値

IEnumerable<Attribute>

element に適用され、指定された条件と一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes(Assembly, Type)

指定されたアセンブリに適用されている、指定された型のカスタム属性のコレクションを取得します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Assembly ^ element, Type ^ attributeType);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Assembly element, Type attributeType);
static member GetCustomAttributes : System.Reflection.Assembly * Type -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Assembly, attributeType As Type) As IEnumerable(Of Attribute)

パラメーター

element
Assembly

調べるアセンブリ。

attributeType
Type

検索する属性の種類。

戻り値

IEnumerable<Attribute>

element に適用され、attributeType に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

element または attributeTypenull です。

attributeTypeAttribute から派生していません。

適用対象

GetCustomAttributes(ParameterInfo)

指定されたパラメーターに適用されるカスタム属性のコレクションを取得します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.ParameterInfo element);
static member GetCustomAttributes : System.Reflection.ParameterInfo -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As ParameterInfo) As IEnumerable(Of Attribute)

パラメーター

element
ParameterInfo

調べるパラメーター。

戻り値

IEnumerable<Attribute>

element に適用されるカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes(Module)

指定されたモジュールに適用されるカスタム属性のコレクションを取得します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Module ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Module element);
static member GetCustomAttributes : System.Reflection.Module -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Module) As IEnumerable(Of Attribute)

パラメーター

element
Module

調べるモジュール。

戻り値

IEnumerable<Attribute>

element に適用されるカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

適用対象

GetCustomAttributes(MemberInfo)

指定されたメンバーに適用されるカスタム属性のコレクションを取得します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.MemberInfo element);
static member GetCustomAttributes : System.Reflection.MemberInfo -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As MemberInfo) As IEnumerable(Of Attribute)

パラメーター

element
MemberInfo

調べるメンバー。

戻り値

IEnumerable<Attribute>

element に適用されるカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes(Assembly)

指定されたアセンブリに適用されるカスタム属性のコレクションを取得します。

public:
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<Attribute ^> ^ GetCustomAttributes(System::Reflection::Assembly ^ element);
public static System.Collections.Generic.IEnumerable<Attribute> GetCustomAttributes (this System.Reflection.Assembly element);
static member GetCustomAttributes : System.Reflection.Assembly -> seq<Attribute>
<Extension()>
Public Function GetCustomAttributes (element As Assembly) As IEnumerable(Of Attribute)

パラメーター

element
Assembly

調べるアセンブリ。

戻り値

IEnumerable<Attribute>

element に適用されるカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

適用対象

GetCustomAttributes<T>(ParameterInfo, Boolean)

指定されたパラメーターに適用される指定された型のカスタム属性のコレクションを取得し、オプションでそのパラメーターの先祖を調べます。

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.ParameterInfo element, bool inherit) where T : Attribute;
static member GetCustomAttributes : System.Reflection.ParameterInfo * bool -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As ParameterInfo, inherit As Boolean) As IEnumerable(Of T)

型パラメーター

T

検索する属性の種類。

パラメーター

element
ParameterInfo

調べるパラメーター。

inherit
Boolean

element の先祖を調べる場合は true。それ以外の場合は false

戻り値

IEnumerable<T>

element に適用され、T に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes<T>(MemberInfo, Boolean)

指定されたメンバーに適用されている指定された型のカスタム属性のコレクションを取得し、オプションでそのメンバーの先祖を調べます。

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element, bool inherit);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.MemberInfo element, bool inherit) where T : Attribute;
static member GetCustomAttributes : System.Reflection.MemberInfo * bool -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As MemberInfo, inherit As Boolean) As IEnumerable(Of T)

型パラメーター

T

検索する属性の種類。

パラメーター

element
MemberInfo

調べるメンバー。

inherit
Boolean

element の先祖を調べる場合は true。それ以外の場合は false

戻り値

IEnumerable<T>

element に適用され、T に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes<T>(ParameterInfo)

指定されたパラメーターに適用される指定された型のカスタム属性のコレクションを取得します。

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::ParameterInfo ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.ParameterInfo element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.ParameterInfo -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As ParameterInfo) As IEnumerable(Of T)

型パラメーター

T

検索する属性の種類。

パラメーター

element
ParameterInfo

調べるパラメーター。

戻り値

IEnumerable<T>

element に適用され、T に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes<T>(MemberInfo)

指定されたメンバーに適用される指定された型のカスタム属性のコレクションを取得します。

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::MemberInfo ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.MemberInfo element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.MemberInfo -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As MemberInfo) As IEnumerable(Of T)

型パラメーター

T

検索する属性の種類。

パラメーター

element
MemberInfo

調べるメンバー。

戻り値

IEnumerable<T>

element に適用され、T に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

elementがコンストラクター、メソッド、プロパティ、イベント、型、またはフィールドではありません。

カスタム属性の型を読み込むことはできません。

適用対象

GetCustomAttributes<T>(Assembly)

指定されたアセンブリに適用されている、指定された型のカスタム属性のコレクションを取得します。

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::Assembly ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.Assembly element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.Assembly -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As Assembly) As IEnumerable(Of T)

型パラメーター

T

検索する属性の種類。

パラメーター

element
Assembly

調べるアセンブリ。

戻り値

IEnumerable<T>

element に適用され、T に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

適用対象

GetCustomAttributes<T>(Module)

指定されたモジュールに適用される指定された型のカスタム属性のコレクションを取得します。

public:
generic <typename T>
 where T : Attribute[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::IEnumerable<T> ^ GetCustomAttributes(System::Reflection::Module ^ element);
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T> (this System.Reflection.Module element) where T : Attribute;
static member GetCustomAttributes : System.Reflection.Module -> seq<'T (requires 'T :> Attribute)> (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttributes(Of T As Attribute) (element As Module) As IEnumerable(Of T)

型パラメーター

T

検索する属性の種類。

パラメーター

element
Module

調べるモジュール。

戻り値

IEnumerable<T>

element に適用され、T に一致するカスタム属性のコレクション。該当する属性が存在しない場合は空のコレクション。

例外

elementnullです。

適用対象