CustomAttributeExtensions.GetCustomAttribute 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 요소에 적용되는 사용자 지정 특성을 검색합니다.
오버로드
| Name | Description |
|---|---|
| GetCustomAttribute(Assembly, Type) |
지정된 어셈블리에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다. |
| GetCustomAttribute(MemberInfo, Type) |
지정된 멤버에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다. |
| GetCustomAttribute(Module, Type) |
지정된 모듈에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다. |
| GetCustomAttribute(ParameterInfo, Type) |
지정된 매개 변수에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다. |
| GetCustomAttribute(MemberInfo, Type, Boolean) |
지정된 멤버에 적용되는 지정된 형식의 사용자 지정 특성을 검색하고 필요에 따라 해당 멤버의 상위 항목을 검사합니다. |
| GetCustomAttribute(ParameterInfo, Type, Boolean) |
지정된 매개 변수에 적용되는 지정된 형식의 사용자 지정 특성을 검색하고 선택적으로 해당 매개 변수의 상위 항목을 검사합니다. |
| GetCustomAttribute<T>(ParameterInfo, Boolean) |
지정된 매개 변수에 적용되는 지정된 형식의 사용자 지정 특성을 검색하고 선택적으로 해당 매개 변수의 상위 항목을 검사합니다. |
| GetCustomAttribute<T>(MemberInfo, Boolean) |
지정된 멤버에 적용되는 지정된 형식의 사용자 지정 특성을 검색하고 필요에 따라 해당 멤버의 상위 항목을 검사합니다. |
| GetCustomAttribute<T>(ParameterInfo) |
지정된 매개 변수에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다. |
| GetCustomAttribute<T>(Module) |
지정된 모듈에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다. |
| GetCustomAttribute<T>(MemberInfo) |
지정된 멤버에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다. |
| GetCustomAttribute<T>(Assembly) |
지정된 어셈블리에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다. |
GetCustomAttribute(Assembly, Type)
지정된 어셈블리에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다.
public:
[System::Runtime::CompilerServices::Extension]
static Attribute ^ GetCustomAttribute(System::Reflection::Assembly ^ element, Type ^ attributeType);
public static Attribute GetCustomAttribute(this System.Reflection.Assembly element, Type attributeType);
static member GetCustomAttribute : System.Reflection.Assembly * Type -> Attribute
<Extension()>
Public Function GetCustomAttribute (element As Assembly, attributeType As Type) As Attribute
매개 변수
- element
- Assembly
검사할 어셈블리입니다.
- attributeType
- Type
검색할 특성의 형식입니다.
반품
일치하는 attributeType사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element 또는 attributeType .입니다 null.
attributeType 에서 파생되지 Attribute않았습니다.
요청된 특성 중 하나 이상이 발견되었습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute(MemberInfo, Type)
지정된 멤버에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다.
public:
[System::Runtime::CompilerServices::Extension]
static Attribute ^ GetCustomAttribute(System::Reflection::MemberInfo ^ element, Type ^ attributeType);
public static Attribute GetCustomAttribute(this System.Reflection.MemberInfo element, Type attributeType);
static member GetCustomAttribute : System.Reflection.MemberInfo * Type -> Attribute
<Extension()>
Public Function GetCustomAttribute (element As MemberInfo, attributeType As Type) As Attribute
매개 변수
- element
- MemberInfo
검사할 멤버입니다.
- attributeType
- Type
검색할 특성의 형식입니다.
반품
일치하는 attributeType사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element 또는 attributeType .입니다 null.
attributeType 에서 파생되지 Attribute않았습니다.
element 는 생성자, 메서드, 속성, 이벤트, 형식 또는 필드가 아닙니다.
요청된 특성 중 하나 이상이 발견되었습니다.
사용자 지정 특성 형식을 로드할 수 없습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute(Module, Type)
지정된 모듈에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다.
public:
[System::Runtime::CompilerServices::Extension]
static Attribute ^ GetCustomAttribute(System::Reflection::Module ^ element, Type ^ attributeType);
public static Attribute GetCustomAttribute(this System.Reflection.Module element, Type attributeType);
static member GetCustomAttribute : System.Reflection.Module * Type -> Attribute
<Extension()>
Public Function GetCustomAttribute (element As Module, attributeType As Type) As Attribute
매개 변수
- element
- Module
검사할 모듈입니다.
- attributeType
- Type
검색할 특성의 형식입니다.
반품
일치하는 attributeType사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element 또는 attributeType .입니다 null.
attributeType 에서 파생되지 Attribute않았습니다.
요청된 특성 중 하나 이상이 발견되었습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute(ParameterInfo, Type)
지정된 매개 변수에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다.
public:
[System::Runtime::CompilerServices::Extension]
static Attribute ^ GetCustomAttribute(System::Reflection::ParameterInfo ^ element, Type ^ attributeType);
public static Attribute GetCustomAttribute(this System.Reflection.ParameterInfo element, Type attributeType);
static member GetCustomAttribute : System.Reflection.ParameterInfo * Type -> Attribute
<Extension()>
Public Function GetCustomAttribute (element As ParameterInfo, attributeType As Type) As Attribute
매개 변수
- element
- ParameterInfo
검사할 매개 변수입니다.
- attributeType
- Type
검색할 특성의 형식입니다.
반품
일치하는 attributeType사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element 또는 attributeType .입니다 null.
attributeType 에서 파생되지 Attribute않았습니다.
요청된 특성 중 하나 이상이 발견되었습니다.
사용자 지정 특성 형식을 로드할 수 없습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute(MemberInfo, Type, Boolean)
지정된 멤버에 적용되는 지정된 형식의 사용자 지정 특성을 검색하고 필요에 따라 해당 멤버의 상위 항목을 검사합니다.
public:
[System::Runtime::CompilerServices::Extension]
static Attribute ^ GetCustomAttribute(System::Reflection::MemberInfo ^ element, Type ^ attributeType, bool inherit);
public static Attribute GetCustomAttribute(this System.Reflection.MemberInfo element, Type attributeType, bool inherit);
static member GetCustomAttribute : System.Reflection.MemberInfo * Type * bool -> Attribute
<Extension()>
Public Function GetCustomAttribute (element As MemberInfo, attributeType As Type, inherit As Boolean) As Attribute
매개 변수
- element
- MemberInfo
검사할 멤버입니다.
- attributeType
- Type
검색할 특성의 형식입니다.
- inherit
- Boolean
반품
일치하는 attributeType사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element 또는 attributeType .입니다 null.
attributeType 에서 파생되지 Attribute않았습니다.
element 는 생성자, 메서드, 속성, 이벤트, 형식 또는 필드가 아닙니다.
요청된 특성 중 하나 이상이 발견되었습니다.
사용자 지정 특성 형식을 로드할 수 없습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute(ParameterInfo, Type, Boolean)
지정된 매개 변수에 적용되는 지정된 형식의 사용자 지정 특성을 검색하고 선택적으로 해당 매개 변수의 상위 항목을 검사합니다.
public:
[System::Runtime::CompilerServices::Extension]
static Attribute ^ GetCustomAttribute(System::Reflection::ParameterInfo ^ element, Type ^ attributeType, bool inherit);
public static Attribute GetCustomAttribute(this System.Reflection.ParameterInfo element, Type attributeType, bool inherit);
static member GetCustomAttribute : System.Reflection.ParameterInfo * Type * bool -> Attribute
<Extension()>
Public Function GetCustomAttribute (element As ParameterInfo, attributeType As Type, inherit As Boolean) As Attribute
매개 변수
- element
- ParameterInfo
검사할 매개 변수입니다.
- attributeType
- Type
검색할 특성의 형식입니다.
- inherit
- Boolean
반품
일치하는 attributeType사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element 또는 attributeType .입니다 null.
attributeType 에서 파생되지 Attribute않았습니다.
요청된 특성 중 하나 이상이 발견되었습니다.
사용자 지정 특성 형식을 로드할 수 없습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute<T>(ParameterInfo, Boolean)
지정된 매개 변수에 적용되는 지정된 형식의 사용자 지정 특성을 검색하고 선택적으로 해당 매개 변수의 상위 항목을 검사합니다.
public:
generic <typename T>
where T : Attribute[System::Runtime::CompilerServices::Extension]
static T GetCustomAttribute(System::Reflection::ParameterInfo ^ element, bool inherit);
public static T GetCustomAttribute<T>(this System.Reflection.ParameterInfo element, bool inherit) where T : Attribute;
static member GetCustomAttribute : System.Reflection.ParameterInfo * bool -> 'T (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttribute(Of T As Attribute) (element As ParameterInfo, inherit As Boolean) As T
형식 매개 변수
- T
검색할 특성의 형식입니다.
매개 변수
- element
- ParameterInfo
검사할 매개 변수입니다.
- inherit
- Boolean
반품
일치하는 T사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element은 null입니다.
element 는 생성자, 메서드, 속성, 이벤트, 형식 또는 필드가 아닙니다.
요청된 특성 중 하나 이상이 발견되었습니다.
사용자 지정 특성 형식을 로드할 수 없습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute<T>(MemberInfo, Boolean)
지정된 멤버에 적용되는 지정된 형식의 사용자 지정 특성을 검색하고 필요에 따라 해당 멤버의 상위 항목을 검사합니다.
public:
generic <typename T>
where T : Attribute[System::Runtime::CompilerServices::Extension]
static T GetCustomAttribute(System::Reflection::MemberInfo ^ element, bool inherit);
public static T GetCustomAttribute<T>(this System.Reflection.MemberInfo element, bool inherit) where T : Attribute;
static member GetCustomAttribute : System.Reflection.MemberInfo * bool -> 'T (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttribute(Of T As Attribute) (element As MemberInfo, inherit As Boolean) As T
형식 매개 변수
- T
검색할 특성의 형식입니다.
매개 변수
- element
- MemberInfo
검사할 멤버입니다.
- inherit
- Boolean
반품
일치하는 T사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element은 null입니다.
element 는 생성자, 메서드, 속성, 이벤트, 형식 또는 필드가 아닙니다.
요청된 특성 중 하나 이상이 발견되었습니다.
사용자 지정 특성 형식을 로드할 수 없습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute<T>(ParameterInfo)
지정된 매개 변수에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다.
public:
generic <typename T>
where T : Attribute[System::Runtime::CompilerServices::Extension]
static T GetCustomAttribute(System::Reflection::ParameterInfo ^ element);
public static T GetCustomAttribute<T>(this System.Reflection.ParameterInfo element) where T : Attribute;
static member GetCustomAttribute : System.Reflection.ParameterInfo -> 'T (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttribute(Of T As Attribute) (element As ParameterInfo) As T
형식 매개 변수
- T
검색할 특성의 형식입니다.
매개 변수
- element
- ParameterInfo
검사할 매개 변수입니다.
반품
일치하는 T사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element은 null입니다.
element 는 생성자, 메서드, 속성, 이벤트, 형식 또는 필드가 아닙니다.
요청된 특성 중 하나 이상이 발견되었습니다.
사용자 지정 특성 형식을 로드할 수 없습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute<T>(Module)
지정된 모듈에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다.
public:
generic <typename T>
where T : Attribute[System::Runtime::CompilerServices::Extension]
static T GetCustomAttribute(System::Reflection::Module ^ element);
public static T GetCustomAttribute<T>(this System.Reflection.Module element) where T : Attribute;
static member GetCustomAttribute : System.Reflection.Module -> 'T (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttribute(Of T As Attribute) (element As Module) As T
형식 매개 변수
- T
검색할 특성의 형식입니다.
매개 변수
- element
- Module
검사할 모듈입니다.
반품
일치하는 T사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element은 null입니다.
요청된 특성 중 하나 이상이 발견되었습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute<T>(MemberInfo)
지정된 멤버에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다.
public:
generic <typename T>
where T : Attribute[System::Runtime::CompilerServices::Extension]
static T GetCustomAttribute(System::Reflection::MemberInfo ^ element);
public static T GetCustomAttribute<T>(this System.Reflection.MemberInfo element) where T : Attribute;
static member GetCustomAttribute : System.Reflection.MemberInfo -> 'T (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttribute(Of T As Attribute) (element As MemberInfo) As T
형식 매개 변수
- T
검색할 특성의 형식입니다.
매개 변수
- element
- MemberInfo
검사할 멤버입니다.
반품
일치하는 T사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element은 null입니다.
element 는 생성자, 메서드, 속성, 이벤트, 형식 또는 필드가 아닙니다.
요청된 특성 중 하나 이상이 발견되었습니다.
사용자 지정 특성 형식을 로드할 수 없습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.
적용 대상
GetCustomAttribute<T>(Assembly)
지정된 어셈블리에 적용되는 지정된 형식의 사용자 지정 특성을 검색합니다.
public:
generic <typename T>
where T : Attribute[System::Runtime::CompilerServices::Extension]
static T GetCustomAttribute(System::Reflection::Assembly ^ element);
public static T GetCustomAttribute<T>(this System.Reflection.Assembly element) where T : Attribute;
static member GetCustomAttribute : System.Reflection.Assembly -> 'T (requires 'T :> Attribute)
<Extension()>
Public Function GetCustomAttribute(Of T As Attribute) (element As Assembly) As T
형식 매개 변수
- T
검색할 특성의 형식입니다.
매개 변수
- element
- Assembly
검사할 어셈블리입니다.
반품
일치하는 T사용자 지정 특성이거나 null 이러한 특성을 찾을 수 없는 경우
예외
element은 null입니다.
요청된 특성 중 하나 이상이 발견되었습니다.
설명
둘 이상의 값이 GetCustomAttributes 반환 AmbiguousMatchException 되거나 throw될 것으로 예상되는 경우 확장 메서드를 사용합니다.