英語で読む

次の方法で共有


Module.GetMethod メソッド

定義

指定した基準のメソッドを返します。

オーバーロード

GetMethod(String)

指定された名前のメソッドを返します。

GetMethod(String, Type[])

指定した名前とパラメーター型のメソッドを返します。

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

指定された名前、バインド情報、呼び出し規則、パラメーターの型と修飾子を持つメソッドを返します。

GetMethod(String)

ソース:
Module.cs
ソース:
Module.cs
ソース:
Module.cs

指定された名前のメソッドを返します。

C#
public System.Reflection.MethodInfo? GetMethod (string name);
C#
public System.Reflection.MethodInfo GetMethod (string name);

パラメーター

name
String

メソッド名。

戻り値

指定した名前を持つ MethodInfo オブジェクト。メソッドが存在しない場合は null

例外

namenullです。

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.5, 1.6, 2.0, 2.1

GetMethod(String, Type[])

ソース:
Module.cs
ソース:
Module.cs
ソース:
Module.cs

指定した名前とパラメーター型のメソッドを返します。

C#
public System.Reflection.MethodInfo? GetMethod (string name, Type[] types);
C#
public System.Reflection.MethodInfo GetMethod (string name, Type[] types);

パラメーター

name
String

メソッド名。

types
Type[]

検索対象のパラメーター型。

戻り値

指定した条件に一致する MethodInfo オブジェクト。メソッドが存在しない場合は null

例外

namenull か、typesnull か、types (i) が null です。

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.5, 1.6, 2.0, 2.1

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

ソース:
Module.cs
ソース:
Module.cs
ソース:
Module.cs

指定された名前、バインド情報、呼び出し規則、パラメーターの型と修飾子を持つメソッドを返します。

C#
public System.Reflection.MethodInfo? GetMethod (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, Type[] types, System.Reflection.ParameterModifier[]? modifiers);
C#
public System.Reflection.MethodInfo GetMethod (string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, Type[] types, System.Reflection.ParameterModifier[] modifiers);

パラメーター

name
String

メソッド名。

bindingAttr
BindingFlags

検索を制御するために使用される BindingFlags ビット フラグのいずれか。

binder
Binder

このメソッドに関連するプロパティが含まれ、Binder を実装するオブジェクト。

callConvention
CallingConventions

メソッドの呼び出し規則。

types
Type[]

検索対象のパラメーター型。

modifiers
ParameterModifier[]

型が変更されているパラメーター シグネチャでバインドを機能させるために使われるパラメーター修飾子の配列。

戻り値

指定した条件に一致する MethodInfo オブジェクト。メソッドが存在しない場合は null

例外

namenull か、typesnull か、types (i) が null です。

こちらもご覧ください

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1