Type.GetConstructorImpl 메서드

정의

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

protected:
 abstract System::Reflection::ConstructorInfo ^ GetConstructorImpl(System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, System::Reflection::CallingConventions callConvention, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
protected abstract System.Reflection.ConstructorInfo? GetConstructorImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, Type[] types, System.Reflection.ParameterModifier[]? modifiers);
protected abstract System.Reflection.ConstructorInfo GetConstructorImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetConstructorImpl : System.Reflection.BindingFlags * System.Reflection.Binder * System.Reflection.CallingConventions * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.ConstructorInfo
Protected MustOverride Function GetConstructorImpl (bindingAttr As BindingFlags, binder As Binder, callConvention As CallingConventions, types As Type(), modifiers As ParameterModifier()) As ConstructorInfo

매개 변수

bindingAttr
BindingFlags

검색 방법을 지정하는 열거형 값의 비트 조합입니다.

또는 null을 반환하는 Default입니다.

binder
Binder

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

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

callConvention
CallingConventions

인수의 순서 및 레이아웃, 반환 값의 전달 방법, 인수에 사용되는 레지스터, 스택 정리 방법 등과 관련하여 사용할 규칙을 지정하는 개체입니다.

types
Type[]

가져올 생성자에 대한 매개 변수의 수, 차수, 형식 등을 나타내는 Type 개체 배열입니다.

또는 매개 변수를 사용하지 않는 생성자를 가져오기 위한 Type 형식의 빈 배열입니다(즉, Type[] types = new Type[0]).

modifiers
ParameterModifier[]

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

반환

ConstructorInfo

지정된 요구 사항과 일치하는 생성자를 나타내는 ConstructorInfo 개체가 있으면 이 개체를 반환하고, 그렇지 않으면 null을 반환합니다.

예외

types이(가) null인 경우

또는 types의 요소 중 하나가 null입니다.

types가 다차원 배열인 경우

또는 modifiers가 다차원 배열인 경우

또는 typesmodifiers의 길이가 동일하지 않습니다.

설명

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

정확히 일치 하는 항목이 없는 경우는 binder 일치 항목을 선택 하기 위해 배열에 지정 된 매개 변수 형식을 강제 변환 하려고 합니다 types . 에서 binder 일치 항목을 선택할 수 없으면 null 이 반환 됩니다.

다음 BindingFlags 필터 플래그를 사용 하 여 검색에 포함할 생성자를 정의할 수 있습니다.

  • BindingFlags.Instance반환을 얻으려면 또는 중 하나를 지정 해야 합니다 BindingFlags.Static .

  • BindingFlags.Public검색에 public 생성자를 포함 하도록 지정 합니다.

  • BindingFlags.NonPublic검색에서 public이 아닌 생성자 (즉, private, internal 및 protected 생성자)를 포함 하도록 지정 합니다.

자세한 내용은 System.Reflection.BindingFlags를 참조하세요.

이 메서드는 GetConstructor를 구현합니다.

적용 대상

추가 정보