Type.GetPropertyImpl 메서드

파생 클래스에서 재정의된 경우, 지정된 인수 형식 및 한정자와 일치하는 매개 변수를 가진 지정된 속성을 지정된 바인딩 제약 조건으로 검색합니다.

네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Protected MustOverride Function GetPropertyImpl ( _
    name As String, _
    bindingAttr As BindingFlags, _
    binder As Binder, _
    returnType As Type, _
    types As Type(), _
    modifiers As ParameterModifier() _
) As PropertyInfo
‘사용 방법
Dim name As String
Dim bindingAttr As BindingFlags
Dim binder As Binder
Dim returnType As Type
Dim types As Type()
Dim modifiers As ParameterModifier()
Dim returnValue As PropertyInfo

returnValue = Me.GetPropertyImpl(name, bindingAttr, binder, returnType, types, modifiers)
protected abstract PropertyInfo GetPropertyImpl (
    string name,
    BindingFlags bindingAttr,
    Binder binder,
    Type returnType,
    Type[] types,
    ParameterModifier[] modifiers
)
protected:
virtual PropertyInfo^ GetPropertyImpl (
    String^ name, 
    BindingFlags bindingAttr, 
    Binder^ binder, 
    Type^ returnType, 
    array<Type^>^ types, 
    array<ParameterModifier>^ modifiers
) abstract
protected abstract PropertyInfo GetPropertyImpl (
    String name, 
    BindingFlags bindingAttr, 
    Binder binder, 
    Type returnType, 
    Type[] types, 
    ParameterModifier[] modifiers
)
protected abstract function GetPropertyImpl (
    name : String, 
    bindingAttr : BindingFlags, 
    binder : Binder, 
    returnType : Type, 
    types : Type[], 
    modifiers : ParameterModifier[]
) : PropertyInfo

매개 변수

  • name
    가져올 속성의 이름이 들어 있는 String입니다.
  • bindingAttr
    검색 방법을 지정하는 하나 이상의 BindingFlags로 구성된 비트 마스크입니다.

    - 또는 -

    0(Null 참조(Visual Basic의 경우 Nothing)를 반환하는 경우)

  • binder
    속성 집합을 정의하고 바인딩을 활성화하는 Binder 개체입니다. 이 개체는 또한 리플렉션을 통해 오버로드된 멤버를 선택할 수 있고 인수 형식을 강제 변환할 수 있으며 멤버를 호출할 수도 있습니다.

    - 또는 -

    DefaultBinder를 사용하려는 경우 Null 참조(Visual Basic의 경우 Nothing)입니다.

  • returnType
    속성의 반환 형식입니다.
  • types
    가져올 인덱싱된 속성에 대한 매개 변수의 수, 차수, 형식 등을 나타내는 Type 개체 배열입니다.

    - 또는 -

    인덱싱되지 않은 속성을 가져오기 위한 Type 형식의 빈 배열입니다(즉, Type[] types = new Type[0]).

  • modifiers
    types 배열에서 해당하는 요소와 연관된 특성을 나타내는 ParameterModifier 개체 배열입니다. 기본 바인더에서는 이 매개 변수를 처리하지 않습니다.

반환 값

지정된 요구 사항과 일치하는 속성을 나타내는 PropertyInfo 개체가 있으면 이 개체를 반환하고, 그렇지 않으면 Null 참조(Visual Basic의 경우 Nothing)를 반환합니다.

예외

예외 형식 조건

AmbiguousMatchException

지정된 이름을 가지고 있으며 지정된 바인딩 제약 조건과 일치하는 속성이 둘 이상 발견된 경우

ArgumentNullException

name이 Null 참조(Visual Basic의 경우 Nothing)인 경우

- 또는 -

types가 Null 참조(Visual Basic의 경우 Nothing)인 경우

- 또는 -

types의 요소 중 하나가 Null 참조(Visual Basic의 경우 Nothing)인 경우

ArgumentException

types가 다차원 배열인 경우

- 또는 -

modifiers가 다차원 배열인 경우

- 또는 -

types와 modifiers의 길이가 같지 않은 경우

설명

기본 바인더에서 ParameterModifier(modifiers 매개 변수)를 처리하지 않더라도 추상 System.Reflection.Binder 클래스를 사용하여 modifiers를 처리하는 사용자 지정 바인더를 작성할 수 있습니다. ParameterModifier는 COM interop를 통해 호출할 때에만 사용할 수 있으며 참조로 전달된 매개 변수만 처리됩니다.

types 배열과 modifiers 배열의 길이가 같습니다. types 배열에 지정된 매개 변수는 modifiers 배열에 지정된 pdIn, pdOut, pdLcid, pdRetval, pdOptional, pdHasDefault 특성을 사용할 수 있습니다. 이 특성은 각각 [In], [Out], [lcid], [retval], [optional] 및 해당 매개 변수에 기본값이 있는지 여부를 지정하는 값을 나타냅니다. 매개 변수의 관련 특성은 메타데이터에 저장되고 상호 운용성에 사용됩니다.

다음과 같은 BindingFlags 필터 플래그를 사용하여 검색에 포함할 속성을 정의할 수 있습니다.

  • 반환 값을 가져오려면 BindingFlags.Instance 또는 BindingFlags.Static을 지정해야 합니다.

  • 검색에 public 속성을 포함하려면 BindingFlags.Public을 지정합니다.

  • 검색에 public이 아닌 속성, 즉 private 속성 및 protected 속성을 포함하려면 BindingFlags.NonPublic을 지정합니다.

  • BindingFlags.FlattenHierarchy를 지정하여 publicprotected 정적 멤버를 이 계층 구조에 포함시킵니다. 상속된 클래스의 private 정적 멤버는 포함되지 않습니다.

다음과 같은 BindingFlags 한정자 플래그를 사용하여 검색 작동 방법을 변경할 수 있습니다.

  • name의 대/소문자를 무시하기 위한 BindingFlags.IgnoreCase

  • 단순히 상속된 속성을 검색하지 않고 Type에 선언된 속성만 검색하는 BindingFlags.DeclaredOnly

자세한 내용은 System.Reflection.BindingFlags를 참조하십시오.

요청된 형식이 public 형식이 아니고 public 형식이 아닌 개체를 현재 어셈블리의 외부에 리플렉션할 수 있는 ReflectionPermission이 호출자에게 없는 경우 이 메서드는 Null 참조(Visual Basic의 경우 Nothing)를 반환합니다.

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

Type 클래스
Type 멤버
System 네임스페이스
PropertyInfo
String 클래스
BindingFlags
Binder
DefaultBinder
ParameterModifier
ReflectionPermission
GetProperty
GetProperties