다음을 통해 공유


CodeMethodReferenceExpression 클래스

정의

메서드에 대한 참조를 나타냅니다.

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

예제

다음 코드 예제에서는 메서드를 CodeMethodReferenceExpression 참조하는 데 사용합니다.

// Invokes the TestMethod method of the current type object.
CodeMethodReferenceExpression methodRef1 = new CodeMethodReferenceExpression( new CodeThisReferenceExpression(), "TestMethod" );
CodeMethodInvokeExpression invoke1 = new CodeMethodInvokeExpression( methodRef1, new CodeParameterDeclarationExpression[] {} );

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

//        this.TestMethod();
' Invokes the TestMethod method of the current type object.
Dim methodRef1 As New CodeMethodReferenceExpression(New CodeThisReferenceExpression(), "TestMethod")
Dim invoke1 As New CodeMethodInvokeExpression(methodRef1, New CodeParameterDeclarationExpression() {})

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

'       Me.TestMethod

설명

A는 CodeMethodReferenceExpression Object.Method 형식의 식을 나타내는 데 사용할 수 있습니다.

이 속성은 TargetObject 메서드를 포함하는 개체를 나타냅니다. 이 속성은 MethodName 메서드의 이름을 나타냅니다.

A CodeMethodReferenceExpression 는 호출할 메서드를 나타내고 이벤트를 처리할 메서드를 CodeDelegateCreateExpression 나타내는 데 사용됩니다CodeMethodInvokeExpression.

생성자

Name Description
CodeMethodReferenceExpression()

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

CodeMethodReferenceExpression(CodeExpression, String, CodeTypeReference[])

지정된 대상 개체, 메서드 이름 및 제네릭 형식 인수를 사용하여 클래스의 CodeMethodReferenceExpression 새 인스턴스를 초기화합니다.

CodeMethodReferenceExpression(CodeExpression, String)

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

속성

Name Description
MethodName

참조할 메서드의 이름을 가져오거나 설정합니다.

TargetObject

참조할 메서드를 나타내는 식을 가져오거나 설정합니다.

TypeArguments

현재 제네릭 메서드 참조 식의 형식 인수를 가져옵니다.

UserData

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

(다음에서 상속됨 CodeObject)

메서드

Name Description
Equals(Object)

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

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

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

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상