Type.GetMethodImpl メソッド

定義

オーバーロード

GetMethodImpl(String, Int32, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

派生クラスによってオーバーライドされた場合、指定したバインディング制約および指定した呼び出し規則を使用して、指定したメソッドのうち、指定したジェネリック パラメーターの数、引数の型、修飾子と一致するパラメーターが設定されているものを検索します。

GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

派生クラスによってオーバーライドされた場合、指定したバインディング制約および指定した呼び出し規則を使用して、指定したメソッドのうち、指定した引数の型および修飾子と一致するパラメーターが設定されているものを検索します。

GetMethodImpl(String, Int32, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Source:
Type.cs
Source:
Type.cs
Source:
Type.cs

派生クラスによってオーバーライドされた場合、指定したバインディング制約および指定した呼び出し規則を使用して、指定したメソッドのうち、指定したジェネリック パラメーターの数、引数の型、修飾子と一致するパラメーターが設定されているものを検索します。

protected:
 virtual System::Reflection::MethodInfo ^ GetMethodImpl(System::String ^ name, int genericParameterCount, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, System::Reflection::CallingConventions callConvention, cli::array <Type ^> ^ types, cli::array <System::Reflection::ParameterModifier> ^ modifiers);
protected virtual System.Reflection.MethodInfo? GetMethodImpl (string name, int genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, Type[]? types, System.Reflection.ParameterModifier[]? modifiers);
protected virtual System.Reflection.MethodInfo GetMethodImpl (string name, int genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetMethodImpl : string * int * System.Reflection.BindingFlags * System.Reflection.Binder * System.Reflection.CallingConventions * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.MethodInfo
override this.GetMethodImpl : string * int * System.Reflection.BindingFlags * System.Reflection.Binder * System.Reflection.CallingConventions * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.MethodInfo
Protected Overridable Function GetMethodImpl (name As String, genericParameterCount As Integer, bindingAttr As BindingFlags, binder As Binder, callConvention As CallingConventions, types As Type(), modifiers As ParameterModifier()) As MethodInfo

パラメーター

name
String

取得するメソッドの名前を格納している文字列。

genericParameterCount
Int32

メソッドのジェネリック型パラメーターの数。

bindingAttr
BindingFlags

検索を実施する方法を指定する列挙値のビットごとの組み合わせ。

または

null を返す場合は Default

binder
Binder

一連のプロパティを定義し、バインディングを有効にするオブジェクト。バインディングには、オーバーロードされたメソッドの選択、引数の型の強制変換、リフレクションによるメンバーの呼び出しなどが含まれます。

または

Nothing を使用する場合は、null 参照 (Visual Basic の場合は DefaultBinder)。

callConvention
CallingConventions

引数の順序とレイアウト、戻り値を渡す方法、引数を格納するレジスタ、スタックをクリーンアップするプロセスに関する一連の規則を指定するオブジェクト。

types
Type[]

取得するメソッドのパラメーターの数、順序、および型を表す Type オブジェクトの配列。

または

パラメーターをとらないメソッドを取得するための、 Type 型の空の配列 (Type[] types = new Type[0])。

または

null. typesnull の場合、引数は一致していません。

modifiers
ParameterModifier[]

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

戻り値

指定したジェネリック パラメーターの数、引数の型、修飾子、バインディングの制約、および呼び出し規約に一致するメソッドが存在する場合は、それを表すオブジェクト。それ以外の場合は null

例外

メソッドはオーバーライドし、派生クラスで呼び出す必要があります。

適用対象

GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

Source:
Type.cs
Source:
Type.cs
Source:
Type.cs

派生クラスによってオーバーライドされた場合、指定したバインディング制約および指定した呼び出し規則を使用して、指定したメソッドのうち、指定した引数の型および修飾子と一致するパラメーターが設定されているものを検索します。

protected:
 abstract System::Reflection::MethodInfo ^ GetMethodImpl(System::String ^ name, 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.MethodInfo? GetMethodImpl (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, Type[]? types, System.Reflection.ParameterModifier[]? modifiers);
protected abstract System.Reflection.MethodInfo GetMethodImpl (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, Type[] types, System.Reflection.ParameterModifier[] modifiers);
abstract member GetMethodImpl : string * System.Reflection.BindingFlags * System.Reflection.Binder * System.Reflection.CallingConventions * Type[] * System.Reflection.ParameterModifier[] -> System.Reflection.MethodInfo
Protected MustOverride Function GetMethodImpl (name As String, bindingAttr As BindingFlags, binder As Binder, callConvention As CallingConventions, types As Type(), modifiers As ParameterModifier()) As MethodInfo

パラメーター

name
String

取得するメソッドの名前を格納している文字列。

bindingAttr
BindingFlags

検索を実施する方法を指定する列挙値のビットごとの組み合わせ。

または

null を返す場合は Default

binder
Binder

一連のプロパティを定義し、バインディングを有効にするオブジェクト。バインディングには、オーバーロードされたメソッドの選択、引数の型の強制変換、リフレクションによるメンバーの呼び出しなどが含まれます。

または

Nothing を使用する場合は、null 参照 (Visual Basic の場合は DefaultBinder)。

callConvention
CallingConventions

引数の順序とレイアウト、戻り値を渡す方法、引数を格納するレジスタ、スタックをクリーンアップするプロセスに関する一連の規則を指定するオブジェクト。

types
Type[]

取得するメソッドのパラメーターの数、順序、および型を表す Type オブジェクトの配列。

または

パラメーターをとらないメソッドを取得するための、 Type 型の空の配列 (Type[] types = new Type[0])。

または

null. typesnull の場合、引数は一致していません。

modifiers
ParameterModifier[]

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

戻り値

指定した要件と一致するメソッドが存在する場合は、そのメソッドを表すオブジェクト。それ以外の場合は null

例外

指定した名前を持ち、指定されたバインド制約に一致する 2 つ以上のメソッドが存在します。

namenullです。

types が多次元です。

または

modifiers が多次元です。

または

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

現在の型は TypeBuilder または GenericTypeParameterBuilder です。

注釈

既定のバインダーでは (modifiersパラメーター) は処理ParameterModifierされませんが、抽象System.Reflection.Binderクラスを使用して、 を処理modifiersするカスタム バインダーを記述できます。 ParameterModifier は COM 相互運用機能を介して を呼び出すときにのみ使用され、参照によって渡されるパラメーターのみが処理されます。

typesnull の場合、引数は一致していません。

BindingFlags のフィルター フラグを使用して、検索に含めるメソッドを定義できます。

  • 戻り値を取得するには、 または BindingFlags.StaticBindingFlags.Instance指定する必要があります。

  • 検索にパブリック メソッドを含めるには、 を指定 BindingFlags.Public します。

  • 非パブリック メソッド (つまり、プライベート、内部、および保護されたメソッド) を検索に含めるには、 を指定 BindingFlags.NonPublic します。

  • を指定BindingFlags.FlattenHierarchyして、階層privateのメンバーとprotected静的メンバーを含publicめます。継承されたクラスの静的メンバーは含まれません。

検索のしくみを変更するには、次 BindingFlags の修飾子フラグを使用できます。

  • BindingFlags.IgnoreCase の大文字と小文字を無視する場合 nameは 。

  • BindingFlags.DeclaredOnly で宣言されている Typeメソッドのみを検索する場合は 。単に継承されたメソッドは検索されません。

詳細については、「System.Reflection.BindingFlags」を参照してください。

こちらもご覧ください

適用対象