다음을 통해 공유


CodeMethodInvokeExpression 클래스

정의

메서드를 호출하는 식을 나타냅니다.

public ref class CodeMethodInvokeExpression : System::CodeDom::CodeExpression
public class CodeMethodInvokeExpression : System.CodeDom.CodeExpression
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public class CodeMethodInvokeExpression : System.CodeDom.CodeExpression
type CodeMethodInvokeExpression = class
    inherit CodeExpression
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type CodeMethodInvokeExpression = class
    inherit CodeExpression
Public Class CodeMethodInvokeExpression
Inherits CodeExpression
상속
CodeMethodInvokeExpression
특성

예제

이 예제에서는 메서드를 CodeMethodInvokeExpression 호출하는 데 사용하는 방법을 보여 줍니다.

CodeMethodInvokeExpression methodInvoke = new CodeMethodInvokeExpression(
    // targetObject that contains the method to invoke.
    new CodeThisReferenceExpression(),
    // methodName indicates the method to invoke.
    "Dispose",
    // parameters array contains the parameters for the method.
    new CodeExpression[] { new CodePrimitiveExpression(true) } );

// A C# code generator produces the following source code for the preceeding example code:

// this.Dispose(true);
' This CodeMethodInvokeExpression calls Me.Dispose(true)

    ' The targetObject parameter indicates the object containing the method to invoke.
    ' The methodName parameter indicates the method to invoke.
    ' The parameters array contains the parameters for the method invoke.

    Dim methodInvoke As New CodeMethodInvokeExpression( _
       New CodeThisReferenceExpression(), _
       "Dispose", _
       New CodeExpression() {New CodePrimitiveExpression(True)})

    ' A Visual Basic code generator produces the following source code for the preceeding example code:

    ' Me.Dispose(true)

설명

CodeMethodInvokeExpression 는 메서드를 호출하는 식을 나타내는 데 사용할 수 있습니다.

이 속성은 Method 호출할 메서드를 지정합니다. 이 속성은 Parameters 메서드에 전달할 매개 변수를 나타냅니다. 매개 변수의 필드 방향을 지정하려면 a CodeDirectionExpression 를 사용합니다.

생성자

Name Description
CodeMethodInvokeExpression()

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

CodeMethodInvokeExpression(CodeExpression, String, CodeExpression[])

지정된 대상 개체, 메서드 이름 및 매개 변수를 사용하여 클래스의 CodeMethodInvokeExpression 새 인스턴스를 초기화합니다.

CodeMethodInvokeExpression(CodeMethodReferenceExpression, CodeExpression[])

지정된 메서드 및 매개 변수를 CodeMethodInvokeExpression 사용하여 클래스의 새 인스턴스를 초기화합니다.

속성

Name Description
Method

호출할 메서드를 가져오거나 설정합니다.

Parameters

메서드를 호출할 매개 변수를 가져옵니다.

UserData

현재 개체에 대한 사용자 정의 데이터를 가져옵니다.

(다음에서 상속됨 CodeObject)

메서드

Name Description
Equals(Object)

지정된 개체가 현재 개체와 같은지 여부를 확인합니다.

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

기본 해시 함수로 사용됩니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type 가져옵니다.

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

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

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상

추가 정보