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[]

types 配列内の対応する要素に関連付けられている属性を表す ParameterModifier オブジェクトの配列。 既定のバインダーでは、このパラメーターは処理されません。

戻り値

ConstructorInfo

指定した要件と一致するコンストラクターが存在する場合は、そのコンストラクターを表す ConstructorInfo オブジェクト。それ以外の場合は null

例外

typesnullです。

または types の要素の 1 つが null です。

types が多次元です。

または modifiers が多次元です。

または typesmodifiers の長さが同じではありません。

現在の型は 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 を実装します。

適用対象

こちらもご覧ください