MethodBuilder 클래스

정의

동적 클래스에 메서드(또는 생성자)를 정의하고 표시합니다.

public ref class MethodBuilder sealed : System::Reflection::MethodInfo
public ref class MethodBuilder abstract : System::Reflection::MethodInfo
public ref class MethodBuilder sealed : System::Reflection::MethodInfo, System::Runtime::InteropServices::_MethodBuilder
public sealed class MethodBuilder : System.Reflection.MethodInfo
public abstract class MethodBuilder : 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
type MethodBuilder = class
    inherit 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
Public NotInheritable Class MethodBuilder
Inherits MethodInfo
Public MustInherit Class MethodBuilder
Inherits MethodInfo
Public NotInheritable Class MethodBuilder
Inherits MethodInfo
Implements _MethodBuilder
상속
특성
구현

예제

다음 예제에서는 클래스를 MethodBuilder 사용하여 동적 형식 내에서 메서드를 만듭니다.

using namespace System;
using namespace System::Reflection;
using namespace System::Reflection::Emit;

void AddMethodDynamically( TypeBuilder^ myTypeBld, 
                           String^ mthdName, 
                           array<Type^>^ mthdParams, 
                           Type^ returnType, 
                           String^ mthdAction )
{
   MethodBuilder^ myMthdBld = myTypeBld->DefineMethod( mthdName, static_cast<MethodAttributes>(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++ )
      {
         if ( mthdAction->Equals( "A" ) )
                  ILOut->Emit( OpCodes::Add );
         else
         if ( mthdAction->Equals( "M" ) )
                  ILOut->Emit( OpCodes::Mul );
         else
                  ILOut->Emit( OpCodes::Add );

      }
   }

   ILOut->Emit( OpCodes::Ret );
};

void main()
{
   AppDomain^ myDomain = AppDomain::CurrentDomain;
   AssemblyName^ asmName = gcnew 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;
   array<String^>^inputNumsList = inputNums->Split();
   array<Type^>^myMthdParams = gcnew array<Type^>(inputNumsList->Length);
   array<Object^>^inputValsList = gcnew array<Object^>(inputNumsList->Length);
   for each (String^ inputNum in inputNumsList)
   {
      inputValsList[ index ] = Convert::ToInt32( inputNum );
      myMthdParams[ index ] = int::typeid;
      index++;
   }

   
   // Now, call the method building method with the parameters, passing the
   // TypeBuilder by reference.
   AddMethodDynamically( myTypeBld, 
                         myMthdName, 
                         myMthdParams, 
                         int::typeid, 
                         myMthdAction );
   Type^ myType = myTypeBld->CreateType();

   Console::WriteLine( "---" );
   Console::WriteLine( "The result of {0} the inputted values is: {1}", 
                       ((myMthdAction->Equals( "M" )) ? "multiplying" : "adding"), 
                       myType->InvokeMember( myMthdName, 
                                             BindingFlags::InvokeMethod | BindingFlags::Public | BindingFlags::Static, 
                       nullptr, 
                       nullptr, 
                       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 );
}

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 설명을 참조하세요.

생성자

MethodBuilder()

MethodBuilder 클래스의 새 인스턴스를 초기화합니다.

속성

Attributes

이 메서드에 대한 특성을 검색합니다.

CallingConvention

메서드 호출 규칙을 반환합니다.

ContainsGenericParameters

이 형식에는 지원되지 않습니다.

ContainsGenericParameters

제네릭 메서드에 할당되지 않은 제네릭 형식 매개 변수가 포함되어 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodInfo)
CustomAttributes

이 멤버의 사용자 지정 특성을 포함하는 컬렉션을 가져옵니다.

(다음에서 상속됨 MemberInfo)
DeclaringType

이 메서드를 선언한 형식을 반환합니다.

InitLocals

이 메서드의 지역 변수를 0으로 초기화하는지 여부를 지정하는 부울 값을 가져오거나 설정합니다. 이 속성의 기본값은 true입니다.

InitLocalsCore

파생 클래스에서 재정의되는 경우 이 메서드의 지역 변수가 0으로 초기화되었는지 여부를 나타내는 값을 가져오거나 설정합니다.

IsAbstract

이 메서드가 추상 메서드인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsAssembly

Assembly에서 이 메서드나 생성자의 잠재적 표시 유형을 설명하는지 여부를 나타내는 값을 가져옵니다. 즉, 이 메서드나 생성자는 같은 어셈블리의 다른 형식에만 표시되고 어셈블리 외부의 파생 형식에는 표시되지 않습니다.

(다음에서 상속됨 MethodBase)
IsCollectible

MemberInfo 개체가 수집 가능한 AssemblyLoadContext에 보관된 어셈블리의 일부인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MemberInfo)
IsConstructedGenericMethod

동적 클래스에 메서드(또는 생성자)를 정의하고 표시합니다.

IsConstructedGenericMethod

동적 클래스에 메서드(또는 생성자)를 정의하고 표시합니다.

(다음에서 상속됨 MethodBase)
IsConstructor

메서드가 생성자인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsFamily

Family에서 이 메서드나 생성자의 표시 유형을 설명하는지 여부를 나타내는 값을 가져옵니다. 즉, 이 메서드나 생성자는 해당 클래스 및 파생 클래스에만 표시됩니다.

(다음에서 상속됨 MethodBase)
IsFamilyAndAssembly

FamANDAssem에서 이 메서드나 생성자의 표시 유형을 설명하는지 여부를 나타내는 값을 가져옵니다. 즉, 이 메서드나 생성자는 같은 어셈블리에 있는 경우에만 파생 클래스에서 호출할 수 있습니다.

(다음에서 상속됨 MethodBase)
IsFamilyOrAssembly

FamORAssem에서 이 메서드나 생성자의 잠재적 표시 유형을 설명하는지 여부를 나타내는 값을 가져옵니다. 즉, 이 메서드나 생성자는 파생 클래스(있는 경우) 및 같은 어셈블리의 클래스에서 호출할 수 있습니다.

(다음에서 상속됨 MethodBase)
IsFinal

이 메서드가 final인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsGenericMethod

메서드가 제네릭 메서드인지 여부를 나타내는 값을 가져옵니다.

IsGenericMethod

현재 메서드가 제네릭 메서드인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodInfo)
IsGenericMethodDefinition

현재 MethodBuilder 개체가 제네릭 메서드의 정의를 나타내는지 여부를 표시하는 값을 가져옵니다.

IsGenericMethodDefinition

현재 MethodInfo가 제네릭 메서드 정의를 나타내는지 여부를 표시하는 값을 가져옵니다.

(다음에서 상속됨 MethodInfo)
IsHideBySig

동일한 시그니처가 있는 동일한 종류의 멤버만을 파생 클래스에서 숨길 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsPrivate

이 멤버가 프라이빗인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsPublic

이 메서드가 public 메서드인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsSecurityCritical

모든 경우에 NotSupportedException을(를) throw합니다.

IsSecurityCritical

현재 메서드나 생성자가 현재 신뢰 수준에서 보안에 중요한 형식이거나 보안 안전에 중요한 형식이어서 중요한 작업을 수행할 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsSecuritySafeCritical

모든 경우에 NotSupportedException을(를) throw합니다.

IsSecuritySafeCritical

현재 메서드나 생성자가 현재 신뢰 수준에서 보안 안전에 중요한 형식인지 즉, 중요한 작업을 수행할 수 있고 투명 코드로 액세스할 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsSecurityTransparent

모든 경우에 NotSupportedException을(를) throw합니다.

IsSecurityTransparent

현재 메서드나 생성자가 현재 신뢰 수준에서 투명하여 중요한 작업을 수행할 수 없는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsSpecialName

이 메서드의 이름이 특수한지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsStatic

메서드가 static인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
IsVirtual

메서드가 virtual인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MethodBase)
MemberType

이 멤버가 메서드임을 나타내는 MemberTypes 값을 가져옵니다.

(다음에서 상속됨 MethodInfo)
MetadataToken

메타데이터에서 현재 동적 모듈을 식별하는 토큰을 가져옵니다.

MetadataToken

메타데이터 요소를 식별하는 값을 가져옵니다.

(다음에서 상속됨 MemberInfo)
MethodHandle

메서드에 대한 내부 핸들을 검색합니다. 이 핸들을 사용하여 내부 메타데이터 핸들에 액세스할 수 있습니다.

MethodHandle

메서드의 내부 메타데이터 표현에 대한 핸들을 가져옵니다.

(다음에서 상속됨 MethodBase)
MethodImplementationFlags

동적 클래스에 메서드(또는 생성자)를 정의하고 표시합니다.

MethodImplementationFlags

메서드 구현의 특성을 지정하는 MethodImplAttributes 플래그를 가져옵니다.

(다음에서 상속됨 MethodBase)
Module

현재 메서드가 정의되는 모듈을 가져옵니다.

Module

현재 MemberInfo가 나타내는 멤버를 선언하는 형식이 정의된 모듈을 가져옵니다.

(다음에서 상속됨 MemberInfo)
Name

이 메서드의 이름을 검색합니다.

ReflectedType

이 개체를 얻은 리플렉션에서 사용된 클래스를 검색합니다.

ReflectedType

MemberInfo의 이 인스턴스를 가져오는 데 사용된 클래스 개체를 가져옵니다.

(다음에서 상속됨 MemberInfo)
ReturnParameter

메서드의 반환 형식에 대한 정보(예: 반환 형식에 사용자 지정 한정자가 포함되는지 여부)가 포함된 ParameterInfo 개체를 가져옵니다.

ReturnParameter

메서드의 반환 형식에 대한 정보(예: 반환 형식에 사용자 지정 한정자가 포함되는지 여부)가 포함된 ParameterInfo 개체를 가져옵니다.

(다음에서 상속됨 MethodInfo)
ReturnType

MethodBuilder가 나타내는 메서드의 반환 형식을 가져옵니다.

ReturnType

이 메서드의 반환 형식을 가져옵니다.

(다음에서 상속됨 MethodInfo)
ReturnTypeCustomAttributes

메서드 반환 형식의 사용자 지정 특성을 반환합니다.

ReturnTypeCustomAttributes

반환 형식에 대한 사용자 지정 특성을 가져옵니다.

(다음에서 상속됨 MethodInfo)
Signature

메서드의 시그니처를 검색합니다.

메서드

AddDeclarativeSecurity(SecurityAction, PermissionSet)

이 메서드에 선언적 보안을 추가합니다.

CreateDelegate(Type)

이 메서드로부터 지정된 형식의 대리자를 만듭니다.

(다음에서 상속됨 MethodInfo)
CreateDelegate(Type, Object)

이 메서드로부터 지정된 대상으로 지정된 형식의 대리자를 만듭니다.

(다음에서 상속됨 MethodInfo)
CreateDelegate<T>()

이 메서드에서 T 형식의 대리자를 만듭니다.

(다음에서 상속됨 MethodInfo)
CreateDelegate<T>(Object)

이 메서드에서 지정된 대상을 사용하여 T 형식의 대리자를 만듭니다.

(다음에서 상속됨 MethodInfo)
CreateMethodBody(Byte[], Int32)

MSIL(Microsoft Intermediate Language) 명령의 제공된 바이트 배열을 사용하여 메서드의 본문을 만듭니다.

DefineGenericParameters(String[])

현재 메서드에 대한 제네릭 형식 매개 변수의 개수를 설정하고 이러한 매개 변수의 이름을 지정하며 관련 제약 조건을 정의하는 데 사용할 수 있는 GenericTypeParameterBuilder 개체의 배열을 반환합니다.

DefineGenericParametersCore(String[])

파생 클래스에서 재정의되는 경우 현재 메서드에 대한 제네릭 형식 매개 변수 수를 설정하고, 이름을 지정하고, 제약 조건을 정의하는 데 사용할 수 있는 개체 배열 GenericTypeParameterBuilder 을 반환합니다.

DefineParameter(Int32, ParameterAttributes, String)

이 메서드의 매개 변수 특성 및 이름 또는 이 메서드의 반환 값 특성 및 이름을 설정합니다. 사용자 지정 특성을 적용하는 데 사용할 수 있는 ParameterBuilder를 반환합니다.

DefineParameterCore(Int32, ParameterAttributes, String)

파생 클래스에서 재정의되는 경우 이 메서드에 대한 매개 변수 또는 반환 매개 변수를 정의합니다.

Equals(Object)

지정된 개체가 이 인스턴스와 같은지 여부를 확인합니다.

GetBaseDefinition()

메서드의 기본 구현을 반환합니다.

GetBaseDefinition()

파생 클래스에서 재정의되는 경우 이 인스턴스가 나타내는 메서드가 처음 선언된 직접 또는 간접 기본 클래스의 메서드에 대해 MethodInfo 개체를 반환합니다.

(다음에서 상속됨 MethodInfo)
GetCustomAttributes(Boolean)

이 메서드에 대해 정의된 모든 사용자 지정 특성을 반환합니다.

GetCustomAttributes(Boolean)

파생 클래스에서 재정의되는 경우 이 멤버에 적용된 모든 사용자 지정 특성의 배열을 반환합니다.

(다음에서 상속됨 MemberInfo)
GetCustomAttributes(Type, Boolean)

지정된 형식으로 식별되는 사용자 지정 특성을 반환합니다.

GetCustomAttributes(Type, Boolean)

파생된 클래스에서 재정의하는 경우 이 멤버에 적용되고 Type으로 식별되는 사용자 지정 특성의 배열을 반환합니다.

(다음에서 상속됨 MemberInfo)
GetCustomAttributesData()

대상 멤버에 적용된 특성에 대한 데이터를 나타내는 CustomAttributeData 개체의 목록을 반환합니다.

(다음에서 상속됨 MemberInfo)
GetGenericArguments()

제네릭인 경우 메서드의 형식 매개 변수를 나타내는 GenericTypeParameterBuilder 개체의 배열을 반환합니다.

GetGenericArguments()

제네릭 메서드의 형식 인수나 제네릭 메서드 정의의 형식 매개 변수를 나타내는 Type 개체의 배열을 반환합니다.

(다음에서 상속됨 MethodInfo)
GetGenericMethodDefinition()

이 메서드를 반환합니다.

GetGenericMethodDefinition()

현재 메서드를 생성하는 데 사용할 수 있는 제네릭 메서드 정의를 나타내는 MethodInfo 개체를 반환합니다.

(다음에서 상속됨 MethodInfo)
GetHashCode()

이 메서드의 해시 코드를 가져옵니다.

GetILGenerator()

64바이트의 기본 MSIL(Microsoft Intermediate Language) 스트림 크기를 사용하는 이 메서드에 대한 ILGenerator 를 반환합니다.

GetILGenerator(Int32)

지정된 MSIL(Microsoft Intermediate Language) 스트림 크기를 사용하여 이 메서드에 대한 ILGenerator 를 반환합니다.

GetILGeneratorCore(Int32)

파생 클래스에서 재정의되는 경우 이 메서드에 대한 메서드 본문을 내보내는 데 사용할 수 있는 를 가져옵니다 ILGenerator .

GetMethodBody()

파생 클래스에서 재정의된 경우, 현재 메서드의 MSIL 스트림, 지역 변수 및 예외에 액세스할 수 있도록 하는 MethodBody 개체를 가져옵니다.

(다음에서 상속됨 MethodBase)
GetMethodImplementationFlags()

메서드에 대한 구현 플래그를 반환합니다.

GetMethodImplementationFlags()

파생 클래스에서 재정의할 때 MethodImplAttributes 플래그를 반환합니다.

(다음에서 상속됨 MethodBase)
GetModule()

이 메서드를 포함하는 모듈에 대한 참조를 반환합니다.

GetParameters()

이 메서드의 매개 변수를 반환합니다.

GetToken()

이 메서드에 대한 토큰을 나타내는 MethodToken 을 반환합니다.

GetType()

메서드의 특성을 검색하고 메서드 메타데이터에 대한 액세스를 제공합니다.

(다음에서 상속됨 MethodInfo)
HasSameMetadataDefinitionAs(MemberInfo)

동적 클래스에 메서드(또는 생성자)를 정의하고 표시합니다.

(다음에서 상속됨 MemberInfo)
Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

지정된 바인더의 제약 조건에 따라 지정한 매개 변수를 전달하여 지정된 개체에 있는 이 인스턴스에 의해 반영된 메서드를 동적으로 호출합니다.

Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

파생 클래스에서 재정의된 경우, 지정된 매개 변수를 사용하여 리플렉션된 메서드나 생성자를 호출합니다.

(다음에서 상속됨 MethodBase)
Invoke(Object, Object[])

지정된 매개 변수를 사용하여 현재 인스턴스로 나타낸 메서드 또는 생성자를 호출합니다.

(다음에서 상속됨 MethodInfo)
IsDefined(Type, Boolean)

지정된 사용자 지정 특성 유형이 정의되었는지 확인합니다.

IsDefined(Type, Boolean)

파생 클래스에서 재정의되는 경우 지정된 형식 또는 파생 형식의 특성이 하나 이상 이 멤버에 적용되는지 여부를 나타냅니다.

(다음에서 상속됨 MemberInfo)
MakeGenericMethod(Type[])

지정된 제네릭 형식 인수를 사용하여 현재 제네릭 메서드 정의에서 생성된 제네릭 메서드를 반환합니다.

MakeGenericMethod(Type[])

현재 제네릭 메서드 정의의 형식 매개 변수를 형식 배열의 요소로 대체하고, 결과로 생성된 메서드를 나타내는 MethodInfo 개체를 반환합니다.

(다음에서 상속됨 MethodInfo)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
SetCustomAttribute(ConstructorInfo, Byte[])

지정된 사용자 지정 특성 blob을 사용하여 사용자 지정 특성을 설정합니다.

SetCustomAttribute(CustomAttributeBuilder)

사용자 지정 특성 작성기를 사용하여 사용자 지정 특성을 설정합니다.

SetCustomAttributeCore(ConstructorInfo, ReadOnlySpan<Byte>)

파생 클래스에서 재정의되는 경우 이 어셈블리에서 사용자 지정 특성을 설정합니다.

SetImplementationFlags(MethodImplAttributes)

이 메서드에 대한 구현 플래그를 설정합니다.

SetImplementationFlagsCore(MethodImplAttributes)

파생 클래스에서 재정의되는 경우 이 메서드에 대한 구현 플래그를 설정합니다.

SetMarshal(UnmanagedMarshal)
사용되지 않음.

이 메서드의 반환 형식에 대한 마샬링 정보를 설정합니다.

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

MSIL(Microsoft 중간 언어) 명령의 지정된 바이트 배열을 사용하여 메서드의 본문을 만듭니다.

SetParameters(Type[])

메서드에 대한 매개 변수 개수와 형식을 설정합니다.

SetReturnType(Type)

메서드의 반환 형식을 설정합니다.

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

반환 형식, 매개 변수 형식, 반환 형식과 매개 변수 형식의 필수 및 선택적 사용자 지정 한정자를 포함하여 메서드 시그니처를 설정합니다.

SetSignatureCore(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)
ICustomAttributeProvider.GetCustomAttributes(Boolean)

명명된 특성을 제외하고 이 멤버에 정의된 모든 사용자 지정 특성의 배열을 반환하거나 사용자 지정 특성이 없는 경우 빈 배열을 반환합니다.

(다음에서 상속됨 MemberInfo)
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean)

형식으로 식별되는 이 멤버에 정의된 사용자 지정 특성의 배열을 반환하거나 해당 형식의 사용자 지정 특성이 없는 경우 빈 배열을 반환합니다.

(다음에서 상속됨 MemberInfo)
ICustomAttributeProvider.IsDefined(Type, Boolean)

하나 이상의 attributeType 인스턴스가 이 멤버에 대해 정의되는지 여부를 나타냅니다.

(다음에서 상속됨 MemberInfo)

확장 메서드

GetCustomAttribute(MemberInfo, Type)

지정된 멤버에 적용된 지정된 형식의 사용자 지정 특성을 검색합니다.

GetCustomAttribute(MemberInfo, Type, Boolean)

지정된 형식의 사용자 지정 특성이 지정된 멤버에 적용되는 컬렉션을 검색하거나 선택적으로 해당 멤버의 상위 항목을 검사합니다.

GetCustomAttribute<T>(MemberInfo)

지정된 멤버에 적용된 지정된 형식의 사용자 지정 특성을 검색합니다.

GetCustomAttribute<T>(MemberInfo, Boolean)

지정된 형식의 사용자 지정 특성이 지정된 멤버에 적용되는 컬렉션을 검색하거나 선택적으로 해당 멤버의 상위 항목을 검사합니다.

GetCustomAttributes(MemberInfo)

지정된 멤버에 적용된 사용자 지정 특성 컬렉션을 검색합니다.

GetCustomAttributes(MemberInfo, Boolean)

사용자 지정 특성이 지정된 멤버에 적용되는 컬렉션을 검색하거나 선택적으로 해당 멤버의 상위 항목을 검사합니다.

GetCustomAttributes(MemberInfo, Type)

지정된 멤버에 적용된 지정된 형식의 사용자 지정 특성 컬렉션을 검색합니다.

GetCustomAttributes(MemberInfo, Type, Boolean)

지정된 형식의 사용자 지정 특성이 지정된 멤버에 적용되는 컬렉션을 검색하거나 선택적으로 해당 멤버의 상위 항목을 검사합니다.

GetCustomAttributes<T>(MemberInfo)

지정된 멤버에 적용된 지정된 형식의 사용자 지정 특성 컬렉션을 검색합니다.

GetCustomAttributes<T>(MemberInfo, Boolean)

지정된 형식의 사용자 지정 특성이 지정된 멤버에 적용되는 컬렉션을 검색하거나 선택적으로 해당 멤버의 상위 항목을 검사합니다.

IsDefined(MemberInfo, Type)

지정된 형식의 사용자 지정 특성이 지정된 멤버에 적용되었는지 여부를 나타냅니다.

IsDefined(MemberInfo, Type, Boolean)

지정된 형식의 사용자 지정 특성이 지정된 멤버에 적용되었는지, 또는 선택적으로 상위 항목에 적용되었는지 여부를 결정합니다.

GetMetadataToken(MemberInfo)

사용 가능한 경우 지정된 멤버의 메타데이터 토큰을 가져옵니다.

HasMetadataToken(MemberInfo)

지정된 멤버에 대해 메타데이터 토큰을 사용할 수 있는지를 나타내는 값을 반환합니다.

GetBaseDefinition(MethodInfo)

동적 클래스에 메서드(또는 생성자)를 정의하고 표시합니다.

GetRuntimeBaseDefinition(MethodInfo)

메서드가 처음으로 선언된 직접 또는 간접 기본 클래스에서 지정된 메서드를 표현하는 개체를 검색합니다.

적용 대상