MethodBuilder クラス

定義

動的クラスのメソッド (またはコンストラクター) を定義して表します。

public ref class MethodBuilder sealed : System::Reflection::MethodInfo, System::Runtime::InteropServices::_MethodBuilder
public ref class MethodBuilder sealed : System::Reflection::MethodInfo
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public sealed class MethodBuilder : System.Reflection.MethodInfo, System.Runtime.InteropServices._MethodBuilder
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class MethodBuilder : System.Reflection.MethodInfo, System.Runtime.InteropServices._MethodBuilder
public sealed class MethodBuilder : System.Reflection.MethodInfo
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
type MethodBuilder = class
    inherit MethodInfo
    interface _MethodBuilder
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type MethodBuilder = class
    inherit MethodInfo
    interface _MethodBuilder
type MethodBuilder = class
    inherit MethodInfo
Public NotInheritable Class MethodBuilder
Inherits MethodInfo
Implements _MethodBuilder
Public NotInheritable Class MethodBuilder
Inherits MethodInfo
継承
属性
実装

次の例では、 MethodBuilder クラスを使用して、動的型内にメソッドを作成します。


using System;
using System.Reflection;
using System.Reflection.Emit;

class DemoMethodBuilder
{
    public static void AddMethodDynamically (TypeBuilder myTypeBld,
                                             string mthdName,
                                             Type[] mthdParams,
                                             Type returnType,
                                             string mthdAction)
    {

        MethodBuilder myMthdBld = myTypeBld.DefineMethod(
                                             mthdName,
                                             MethodAttributes.Public |
                                             MethodAttributes.Static,
                                             returnType,
                                             mthdParams);

        ILGenerator ILout = myMthdBld.GetILGenerator();

        int numParams = mthdParams.Length;

        for (byte x=0; x < numParams; x++)
        {
            ILout.Emit(OpCodes.Ldarg_S, x);
        }

        if (numParams > 1)
        {
            for (int y=0; y<(numParams-1); y++)
            {
                switch (mthdAction)
                {
                    case "A": ILout.Emit(OpCodes.Add);
                              break;
                    case "M": ILout.Emit(OpCodes.Mul);
                              break;
                    default: ILout.Emit(OpCodes.Add);
                              break;
                }
            }
        }
        ILout.Emit(OpCodes.Ret);
    }

    public static void Main()
    {
        AppDomain myDomain = AppDomain.CurrentDomain;
        AssemblyName asmName = new AssemblyName();
        asmName.Name = "MyDynamicAsm";

        AssemblyBuilder myAsmBuilder = myDomain.DefineDynamicAssembly(
                                       asmName,
                                       AssemblyBuilderAccess.RunAndSave);

        ModuleBuilder myModule = myAsmBuilder.DefineDynamicModule("MyDynamicAsm",
                                                                  "MyDynamicAsm.dll");

        TypeBuilder myTypeBld = myModule.DefineType("MyDynamicType",
                                                    TypeAttributes.Public);

        // Get info from the user to build the method dynamically.
        Console.WriteLine("Let's build a simple method dynamically!");
        Console.WriteLine("Please enter a few numbers, separated by spaces.");
        string inputNums = Console.ReadLine();
        Console.Write("Do you want to [A]dd (default) or [M]ultiply these numbers? ");
        string myMthdAction = Console.ReadLine().ToUpper();
        Console.Write("Lastly, what do you want to name your new dynamic method? ");
        string myMthdName = Console.ReadLine();

        // Process inputNums into an array and create a corresponding Type array
        int index = 0;
        string[] inputNumsList = inputNums.Split();

        Type[] myMthdParams = new Type[inputNumsList.Length];
        object[] inputValsList = new object[inputNumsList.Length];

        foreach (string inputNum in inputNumsList)
        {
            inputValsList[index] = (object)Convert.ToInt32(inputNum);
                myMthdParams[index] = typeof(int);
                index++;
        }

        // Now, call the method building method with the parameters, passing the
        // TypeBuilder by reference.
        AddMethodDynamically(myTypeBld,
                             myMthdName,
                             myMthdParams,
                             typeof(int),
                             myMthdAction);

        Type myType = myTypeBld.CreateType();

        Console.WriteLine("---");
        Console.WriteLine("The result of {0} the inputted values is: {1}",
                          ((myMthdAction == "M") ? "multiplying" : "adding"),
                          myType.InvokeMember(myMthdName,
                          BindingFlags.InvokeMethod | BindingFlags.Public |
                          BindingFlags.Static,
                          null,
                          null,
                          inputValsList));
        Console.WriteLine("---");

        // Let's take a look at the method we created.
        // If you are interested in seeing the MSIL generated dynamically for the method
        // your program generated, change to the directory where you ran the compiled
        // code sample and type "ildasm MyDynamicAsm.dll" at the prompt. When the list
        // of manifest contents appears, click on "MyDynamicType" and then on the name of
        // of the method you provided during execution.

        myAsmBuilder.Save("MyDynamicAsm.dll");

        MethodInfo myMthdInfo = myType.GetMethod(myMthdName);
        Console.WriteLine("Your Dynamic Method: {0};", myMthdInfo.ToString());
    }
}
Imports System.Reflection
Imports System.Reflection.Emit

Class DemoMethodBuilder
   
   Public Shared Sub AddMethodDynamically(ByVal myTypeBld As TypeBuilder, _
                                          ByVal mthdName As String, _
                                          ByVal mthdParams() As Type, _
                                          ByVal returnType As Type, _
                                          ByVal mthdAction As String)
      
      Dim myMthdBld As MethodBuilder = myTypeBld.DefineMethod(mthdName, _
                                       MethodAttributes.Public Or MethodAttributes.Static, _
                                       returnType, _
                                       mthdParams)
      
      Dim ILout As ILGenerator = myMthdBld.GetILGenerator()
      
      Dim numParams As Integer = mthdParams.Length
      
      Dim x As Byte
      For x = 0 To numParams - 1
         ILout.Emit(OpCodes.Ldarg_S, x)
      Next x
      
      If numParams > 1 Then
         Dim y As Integer
         For y = 0 To (numParams - 1) - 1
            Select Case mthdAction
               Case "A"
                  ILout.Emit(OpCodes.Add)
               Case "M"
                  ILout.Emit(OpCodes.Mul)
               Case Else
                  ILout.Emit(OpCodes.Add)
            End Select
         Next y
      End If
      ILout.Emit(OpCodes.Ret)
   End Sub 
    
   
   Public Shared Sub Main()
      
      Dim myDomain As AppDomain = AppDomain.CurrentDomain
      Dim asmName As New AssemblyName()
      asmName.Name = "MyDynamicAsm"
      
      Dim myAsmBuilder As AssemblyBuilder = myDomain.DefineDynamicAssembly(asmName, _
                                            AssemblyBuilderAccess.RunAndSave)
      
      Dim myModule As ModuleBuilder = myAsmBuilder.DefineDynamicModule("MyDynamicAsm", _
                                                                       "MyDynamicAsm.dll")
      
      Dim myTypeBld As TypeBuilder = myModule.DefineType("MyDynamicType", TypeAttributes.Public)
      
      ' Get info from the user to build the method dynamically.
      Console.WriteLine("Let's build a simple method dynamically!")
      Console.WriteLine("Please enter a few numbers, separated by spaces.")
      Dim inputNums As String = Console.ReadLine()
      Console.Write("Do you want to [A]dd (default) or [M]ultiply these numbers? ")
      Dim myMthdAction As String = Console.ReadLine().ToUpper()
      Console.Write("Lastly, what do you want to name your new dynamic method? ")
      Dim myMthdName As String = Console.ReadLine()
      
      ' Process inputNums into an array and create a corresponding Type array 
      Dim index As Integer = 0
      Dim inputNumsList As String() = inputNums.Split()
      
      Dim myMthdParams(inputNumsList.Length - 1) As Type
      Dim inputValsList(inputNumsList.Length - 1) As Object
      
      
      Dim inputNum As String
      For Each inputNum In  inputNumsList
         inputValsList(index) = CType(Convert.ToInt32(inputNum), Object)
         myMthdParams(index) = GetType(Integer)
         index += 1
      Next inputNum
      
      ' Now, call the method building method with the parameters, passing the 
      ' TypeBuilder by reference.
      AddMethodDynamically(myTypeBld, myMthdName, myMthdParams, GetType(Integer), myMthdAction)
      
      Dim myType As Type = myTypeBld.CreateType()
     
      Dim description as String 
      If myMthdAction = "M" Then
         description = "multiplying"
      Else
         description = "adding"
      End If

      Console.WriteLine("---")
      Console.WriteLine("The result of {0} the values is: {1}", _
                         description, _
                         myType.InvokeMember(myMthdName, _
                                             BindingFlags.InvokeMethod _
                                               Or BindingFlags.Public _
                                               Or BindingFlags.Static, _
                                             Nothing, _
                                             Nothing, _
                                             inputValsList)) 
      Console.WriteLine("---")

      ' If you are interested in seeing the MSIL generated dynamically for the method
      ' your program generated, change to the directory where you ran the compiled
      ' code sample and type "ildasm MyDynamicAsm.dll" at the prompt. When the list
      ' of manifest contents appears, click on "MyDynamicType" and then on the name of
      ' of the method you provided during execution.
 
      myAsmBuilder.Save("MyDynamicAsm.dll") 

      Dim myMthdInfo As MethodInfo = myType.GetMethod(myMthdName)
      Console.WriteLine("Your Dynamic Method: {0};", myMthdInfo.ToString())
   End Sub 
End Class

注釈

この API の詳細については、「 MethodBuilder の補足 API 解説」を参照してください。

プロパティ

名前 説明
Attributes

このメソッドの属性を取得します。

CallingConvention

メソッドの呼び出し規則を返します。

ContainsGenericParameters

この型ではサポートされていません。

CustomAttributes

このメンバーのカスタム属性を含むコレクションを取得します。

(継承元 MemberInfo)
DeclaringType

このメソッドを宣言する型を返します。

InitLocals

このメソッドのローカル変数がゼロ初期化されているかどうかを示すブール値を取得または設定します。 このプロパティの既定値は true です。

IsAbstract

メソッドが抽象であるかどうかを示す値を取得します。

(継承元 MethodBase)
IsAssembly

このメソッドまたはコンストラクターの潜在的な可視性が Assemblyによって記述されているかどうかを示す値を取得します。つまり、メソッドまたはコンストラクターは、同じアセンブリ内の他の型に対して最大で表示され、アセンブリ外の派生型には表示されません。

(継承元 MethodBase)
IsConstructedGenericMethod

動的クラスのメソッド (またはコンストラクター) を定義して表します。

IsConstructor

メソッドがコンストラクターであるかどうかを示す値を取得します。

(継承元 MethodBase)
IsFamily

このメソッドまたはコンストラクターの可視性が Familyによって記述されているかどうかを示す値を取得します。つまり、メソッドまたはコンストラクターは、そのクラスおよび派生クラス内でのみ表示されます。

(継承元 MethodBase)
IsFamilyAndAssembly

このメソッドまたはコンストラクターの可視性が FamANDAssemによって記述されているかどうかを示す値を取得します。つまり、メソッドまたはコンストラクターは派生クラスによって呼び出すことができますが、同じアセンブリ内にある場合にのみ呼び出すことができます。

(継承元 MethodBase)
IsFamilyOrAssembly

このメソッドまたはコンストラクターの潜在的な可視性が FamORAssemによって記述されているかどうかを示す値を取得します。つまり、メソッドまたはコンストラクターは、どこにいても派生クラス、および同じアセンブリ内のクラスによって呼び出すことができます。

(継承元 MethodBase)
IsFinal

このメソッドが finalされているかどうかを示す値を取得します。

(継承元 MethodBase)
IsGenericMethod

メソッドがジェネリック メソッドかどうかを示す値を取得します。

IsGenericMethodDefinition

現在の MethodBuilder オブジェクトがジェネリック メソッドの定義を表すかどうかを示す値を取得します。

IsHideBySig

まったく同じシグネチャを持つ同じ種類のメンバーのみが派生クラスで非表示かどうかを示す値を取得します。

(継承元 MethodBase)
IsPrivate

このメンバーがプライベートかどうかを示す値を取得します。

(継承元 MethodBase)
IsPublic

これがパブリック メソッドであるかどうかを示す値を取得します。

(継承元 MethodBase)
IsSecurityCritical

すべてのケースで NotSupportedException をスローします。

IsSecurityCritical

現在のメソッドまたはコンストラクターが現在の信頼レベルでセキュリティ クリティカルかセキュリティ セーフ クリティカルかを示す値を取得します。そのため、重要な操作を実行できます。

(継承元 MethodBase)
IsSecuritySafeCritical

すべてのケースで NotSupportedException をスローします。

IsSecuritySafeCritical

現在のメソッドまたはコンストラクターが現在の信頼レベルでセキュリティ セーフ クリティカルであるかどうかを示す値を取得します。つまり、重要な操作を実行でき、透過的なコードからアクセスできるかどうかです。

(継承元 MethodBase)
IsSecurityTransparent

すべてのケースで NotSupportedException をスローします。

IsSecurityTransparent

現在のメソッドまたはコンストラクターが現在の信頼レベルで透過的であり、重要な操作を実行できないかどうかを示す値を取得します。

(継承元 MethodBase)
IsSpecialName

このメソッドに特別な名前があるかどうかを示す値を取得します。

(継承元 MethodBase)
IsStatic

メソッドが staticされているかどうかを示す値を取得します。

(継承元 MethodBase)
IsVirtual

メソッドが virtualされているかどうかを示す値を取得します。

(継承元 MethodBase)
MemberType

このメンバーがメソッドであることを示す MemberTypes 値を取得します。

(継承元 MethodInfo)
MetadataToken

メタデータ要素を識別する値を取得します。

(継承元 MemberInfo)
MethodHandle

メソッドの内部ハンドルを取得します。 基になるメタデータ ハンドルにアクセスするには、このハンドルを使用します。

MethodImplementationFlags

メソッド実装の属性を指定する MethodImplAttributes フラグを取得します。

(継承元 MethodBase)
Module

現在のメソッドが定義されているモジュールを取得します。

Name

このメソッドの名前を取得します。

ReflectedType

リフレクションでこのオブジェクトを取得するために使用されたクラスを取得します。

ReturnParameter

戻り値の型にカスタム修飾子があるかどうかなど、メソッドの戻り値の型に関する情報を含む ParameterInfo オブジェクトを取得します。

ReturnType

この MethodBuilderによって表されるメソッドの戻り値の型を取得します。

ReturnType

このメソッドの戻り値の型を取得します。

(継承元 MethodInfo)
ReturnTypeCustomAttributes

メソッドの戻り値の型のカスタム属性を返します。

Signature

メソッドのシグネチャを取得します。

メソッド

名前 説明
AddDeclarativeSecurity(SecurityAction, PermissionSet)

このメソッドに宣言型セキュリティを追加します。

CreateDelegate(Type, Object)

このメソッドから、指定したターゲットを持つ指定した型のデリゲートを作成します。

(継承元 MethodInfo)
CreateDelegate(Type)

このメソッドから、指定した型のデリゲートを作成します。

(継承元 MethodInfo)
CreateMethodBody(Byte[], Int32)

中間言語 (MSIL) 命令の指定されたバイト配列Microsoft使用して、メソッドの本体を作成します。

DefineGenericParameters(String[])

現在のメソッドのジェネリック型パラメーターの数を設定し、その名前を指定し、制約の定義に使用できる GenericTypeParameterBuilder オブジェクトの配列を返します。

DefineParameter(Int32, ParameterAttributes, String)

このメソッドのパラメーターの属性と名前、またはこのメソッドの戻り値を設定します。 カスタム属性の適用に使用できる ParameterBuilder を返します。

Equals(Object)

指定されたオブジェクトがこのインスタンスと等しいかどうかを判断します。

GetBaseDefinition()

メソッドの基本実装を返します。

GetCustomAttributes(Boolean)

このメソッドに定義されているすべてのカスタム属性を返します。

GetCustomAttributes(Type, Boolean)

指定された型によって識別されるカスタム属性を返します。

GetCustomAttributesData()

ターゲット メンバーに適用 CustomAttributeData 属性に関するデータを表すオブジェクトの一覧を返します。

(継承元 MemberInfo)
GetGenericArguments()

ジェネリックの場合は、メソッドの型パラメーターを表す GenericTypeParameterBuilder オブジェクトの配列を返します。

GetGenericMethodDefinition()

このメソッドを返します。

GetHashCode()

このメソッドのハッシュ コードを取得します。

GetILGenerator()

既定のMicrosoft中間言語 (MSIL) ストリーム サイズが 64 バイトのこのメソッドのILGeneratorを返します。

GetILGenerator(Int32)

指定したMicrosoft中間言語 (MSIL) ストリーム サイズを持つ、このメソッドのILGeneratorを返します。

GetMethodBody()

派生クラスでオーバーライドされると、MSIL ストリーム、ローカル変数、および現在のメソッドの例外へのアクセスを提供する MethodBody オブジェクトを取得します。

(継承元 MethodBase)
GetMethodImplementationFlags()

メソッドの実装フラグを返します。

GetModule()

このメソッドを含むモジュールへの参照を返します。

GetParameters()

このメソッドのパラメーターを返します。

GetToken()

このメソッドのトークンを表す MethodToken を返します。

GetType()

メソッドの属性を検出し、メソッド メタデータへのアクセスを提供します。

(継承元 MethodInfo)
HasSameMetadataDefinitionAs(MemberInfo)

動的クラスのメソッド (またはコンストラクター) を定義して表します。

(継承元 MemberInfo)
Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

指定されたオブジェクトでこのインスタンスによって反映されるメソッドを動的に呼び出し、指定されたパラメーターに沿って、および指定されたバインダーの制約の下で渡します。

Invoke(Object, Object[])

指定したパラメーターを使用して、現在のインスタンスによって表されるメソッドまたはコンストラクターを呼び出します。

(継承元 MethodInfo)
IsDefined(Type, Boolean)

指定したカスタム属性の種類が定義されているかどうかを確認します。

MakeGenericMethod(Type[])

指定したジェネリック型引数を使用して、現在のジェネリック メソッド定義から構築されたジェネリック メソッドを返します。

MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
SetCustomAttribute(ConstructorInfo, Byte[])

指定したカスタム属性 BLOB を使用してカスタム属性を設定します。

SetCustomAttribute(CustomAttributeBuilder)

カスタム属性ビルダーを使用してカスタム属性を設定します。

SetImplementationFlags(MethodImplAttributes)

このメソッドの実装フラグを設定します。

SetMarshal(UnmanagedMarshal)
古い.

このメソッドの戻り値の型のマーシャリング情報を設定します。

SetMethodBody(Byte[], Int32, Byte[], IEnumerable<ExceptionHandler>, IEnumerable<Int32>)

中間言語 (MSIL) 命令の指定したバイト配列Microsoft使用して、メソッドの本体を作成します。

SetParameters(Type[])

メソッドのパラメーターの数と型を設定します。

SetReturnType(Type)

メソッドの戻り値の型を設定します。

SetSignature(Type, Type[], Type[], Type[], Type[][], Type[][])

戻り値の型、パラメーター型、戻り値の型とパラメーター型の必須および省略可能なカスタム修飾子など、メソッドシグネチャを設定します。

SetSymCustomAttribute(String, Byte[])

BLOB を使用してシンボリック カスタム属性を設定します。

ToString()

この MethodBuilder インスタンスを文字列として返します。

明示的なインターフェイスの実装

名前 説明
_MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 MemberInfo)
_MemberInfo.GetType()

Type クラスを表すMemberInfo オブジェクトを取得します。

(継承元 MemberInfo)
_MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この型情報を使用して、インターフェイスの型情報を取得できます。

(継承元 MemberInfo)
_MemberInfo.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 MemberInfo)
_MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されるプロパティとメソッドへのアクセスを提供します。

(継承元 MemberInfo)
_MethodBase.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 MethodBase)
_MethodBase.GetType()

このメンバーの説明については、 GetType()を参照してください。

(継承元 MethodBase)
_MethodBase.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この型情報を使用して、インターフェイスの型情報を取得できます。

(継承元 MethodBase)
_MethodBase.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 MethodBase)
_MethodBase.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されるプロパティとメソッドへのアクセスを提供します。

(継承元 MethodBase)
_MethodBase.IsAbstract

このメンバーの説明については、 IsAbstractを参照してください。

(継承元 MethodBase)
_MethodBase.IsAssembly

このメンバーの説明については、 IsAssemblyを参照してください。

(継承元 MethodBase)
_MethodBase.IsConstructor

このメンバーの説明については、 IsConstructorを参照してください。

(継承元 MethodBase)
_MethodBase.IsFamily

このメンバーの説明については、 IsFamilyを参照してください。

(継承元 MethodBase)
_MethodBase.IsFamilyAndAssembly

このメンバーの説明については、 IsFamilyAndAssemblyを参照してください。

(継承元 MethodBase)
_MethodBase.IsFamilyOrAssembly

このメンバーの説明については、 IsFamilyOrAssemblyを参照してください。

(継承元 MethodBase)
_MethodBase.IsFinal

このメンバーの説明については、 IsFinalを参照してください。

(継承元 MethodBase)
_MethodBase.IsHideBySig

このメンバーの説明については、 IsHideBySigを参照してください。

(継承元 MethodBase)
_MethodBase.IsPrivate

このメンバーの説明については、 IsPrivateを参照してください。

(継承元 MethodBase)
_MethodBase.IsPublic

このメンバーの説明については、 IsPublicを参照してください。

(継承元 MethodBase)
_MethodBase.IsSpecialName

このメンバーの説明については、 IsSpecialNameを参照してください。

(継承元 MethodBase)
_MethodBase.IsStatic

このメンバーの説明については、 IsStaticを参照してください。

(継承元 MethodBase)
_MethodBase.IsVirtual

このメンバーの説明については、 IsVirtualを参照してください。

(継承元 MethodBase)
_MethodBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

_MethodBuilder.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この型情報を使用して、インターフェイスの型情報を取得できます。

_MethodBuilder.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

_MethodBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されるプロパティとメソッドへのアクセスを提供します。

_MethodInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 MethodInfo)
_MethodInfo.GetType()

COM から GetType() メソッドへのアクセスを提供します。

(継承元 MethodInfo)
_MethodInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

インターフェイスの型情報を取得するために使用できるオブジェクトの型情報を取得します。

(継承元 MethodInfo)
_MethodInfo.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 MethodInfo)
_MethodInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されるプロパティとメソッドへのアクセスを提供します。

(継承元 MethodInfo)

拡張メソッド

名前 説明
GetCustomAttribute(MemberInfo, Type, Boolean)

指定したメンバーに適用される、指定した型のカスタム属性を取得し、必要に応じてそのメンバーの先祖を検査します。

GetCustomAttribute(MemberInfo, Type)

指定したメンバーに適用される、指定した型のカスタム属性を取得します。

GetCustomAttribute<T>(MemberInfo, Boolean)

指定したメンバーに適用される、指定した型のカスタム属性を取得し、必要に応じてそのメンバーの先祖を検査します。

GetCustomAttribute<T>(MemberInfo)

指定したメンバーに適用される、指定した型のカスタム属性を取得します。

GetCustomAttributes(MemberInfo, Boolean)

指定したメンバーに適用されるカスタム属性のコレクションを取得し、必要に応じてそのメンバーの先祖を検査します。

GetCustomAttributes(MemberInfo, Type, Boolean)

指定したメンバーに適用される、指定した型のカスタム属性のコレクションを取得し、必要に応じてそのメンバーの先祖を検査します。

GetCustomAttributes(MemberInfo, Type)

指定したメンバーに適用される、指定した型のカスタム属性のコレクションを取得します。

GetCustomAttributes(MemberInfo)

指定したメンバーに適用されるカスタム属性のコレクションを取得します。

GetCustomAttributes<T>(MemberInfo, Boolean)

指定したメンバーに適用される、指定した型のカスタム属性のコレクションを取得し、必要に応じてそのメンバーの先祖を検査します。

GetCustomAttributes<T>(MemberInfo)

指定したメンバーに適用される、指定した型のカスタム属性のコレクションを取得します。

GetRuntimeBaseDefinition(MethodInfo)

メソッドが最初に宣言されたダイレクト 基底クラスまたは間接基底クラスで、指定されたメソッドを表すオブジェクトを取得します。

IsDefined(MemberInfo, Type, Boolean)

指定した型のカスタム属性が指定したメンバーに適用され、必要に応じてその先祖に適用されるかどうかを示します。

IsDefined(MemberInfo, Type)

指定した型のカスタム属性が、指定したメンバーに適用されるかどうかを示します。

適用対象