Type.GetConstructorImpl メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
派生クラスでオーバーライドされると、指定したバインディング制約と指定した呼び出し規則を使用して、指定した引数の型と修飾子と一致するパラメーターを持つコンストラクターを検索します。
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);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
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);
protected abstract System.Reflection.ConstructorInfo? GetConstructorImpl(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, Type[] types, System.Reflection.ParameterModifier[]? modifiers);
[<System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)>]
abstract member GetConstructorImpl : System.Reflection.BindingFlags * System.Reflection.Binder * System.Reflection.CallingConventions * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.ConstructorInfo
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
パラメーター
- binder
- Binder
一連のプロパティを定義し、バインディングを有効にするオブジェクト。これには、オーバーロードされたメソッドの選択、引数型の強制型の強制、リフレクションによるメンバーの呼び出しが含まれる場合があります。
-又は-
Nothing を使用するための null 参照 (Visual Basic の DefaultBinder)。
- callConvention
- CallingConventions
引数の順序とレイアウト、戻り値の受け渡し方法、引数に使用されるレジスタ、スタックのクリーンアップに関して使用する規則のセットを指定するオブジェクト。
- types
- Type[]
取得するコンストラクターのパラメーターの数、順序、および型を表す Type オブジェクトの配列。
-又は-
パラメーターを受け取っていないコンストラクターを取得 Type 型の空の配列 (つまり、Type[] 型 = 新しい Type[0])。
- modifiers
- ParameterModifier[]
ParameterModifier配列内の対応する要素に関連付けられた属性を表すtypes オブジェクトの配列。 既定のバインダーでは、このパラメーターは処理されません。
返品
指定した要件に一致するコンストラクターを表す ConstructorInfo オブジェクト (見つかった場合)、それ以外の場合は null。
- 属性
例外
現在の型は、 TypeBuilder または GenericTypeParameterBuilderです。
注釈
既定のバインダーは ParameterModifier ( modifiers パラメーター) を処理しませんが、抽象 System.Reflection.Binder クラスを使用して、 modifiersを処理するカスタム バインダーを記述できます。
ParameterModifier は COM 相互運用機能を介して呼び出すときにのみ使用され、参照渡しのパラメーターのみが処理されます。
完全一致が存在しない場合、 binder は一致を選択するために、 types 配列で指定されたパラメーター型の強制を試みます。
binderが一致するものを選択できない場合は、nullが返されます。
次の BindingFlags フィルター フラグを使用して、検索に含めるコンストラクターを定義できます。
戻り値を取得するには、
BindingFlags.InstanceまたはBindingFlags.Staticを指定する必要があります。検索にパブリック コンストラクターを含める
BindingFlags.Publicを指定します。BindingFlags.NonPublicを指定して、パブリックでないコンストラクター (つまり、プライベート、内部、および保護されたコンストラクター) を検索に含めます。
詳細については、System.Reflection.BindingFlags を参照してください。
このメソッドは、GetConstructor を実装します。