Share via


CodeMethodReferenceExpression Sınıf

Tanım

Yöntem başvurularını temsil eder.

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
Devralma
CodeMethodReferenceExpression
Öznitelikler

Örnekler

Aşağıdaki kod örneği bir CodeMethodReferenceExpression yönteme başvurmak için kullanır:

// Invokes the TestMethod method of the current type object.
CodeMethodReferenceExpression^ methodRef1 = gcnew CodeMethodReferenceExpression( gcnew CodeThisReferenceExpression,"TestMethod" );
array<CodeParameterDeclarationExpression^>^temp1;
CodeMethodInvokeExpression^ invoke1 = gcnew CodeMethodInvokeExpression( methodRef1,temp1 );

// 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.
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çıklamalar

Bir CodeMethodReferenceExpression , Object.Method formunun bir ifadesini temsil etmek için kullanılabilir.

TargetObject özelliği, yöntemini içeren nesneyi gösterir. MethodName özelliği yöntemin adını gösterir.

çağrılacak CodeMethodReferenceExpression yöntemi belirtmek için ile ve CodeMethodInvokeExpression olayı işlemek için yöntemini belirtmek için ile CodeDelegateCreateExpression birlikte kullanılır.

Oluşturucular

CodeMethodReferenceExpression()

CodeMethodReferenceExpression sınıfının yeni bir örneğini başlatır.

CodeMethodReferenceExpression(CodeExpression, String)

Belirtilen hedef nesne ve yöntem adını kullanarak sınıfın CodeMethodReferenceExpression yeni bir örneğini başlatır.

CodeMethodReferenceExpression(CodeExpression, String, CodeTypeReference[])

Belirtilen hedef nesneyi, yöntem adını ve genel tür bağımsız değişkenlerini kullanarak sınıfın yeni bir örneğini CodeMethodReferenceExpression başlatır.

Özellikler

MethodName

Başvurulacak yöntemin adını alır veya ayarlar.

TargetObject

Başvurulacak yöntemi gösteren ifadeyi alır veya ayarlar.

TypeArguments

Geçerli genel yöntem başvuru ifadesi için tür bağımsız değişkenlerini alır.

UserData

Geçerli nesne için kullanıcı tarafından tanımlanabilir verileri alır.

(Devralındığı yer: CodeObject)

Yöntemler

Equals(Object)

Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler.

(Devralındığı yer: Object)
GetHashCode()

Varsayılan karma işlevi işlevi görür.

(Devralındığı yer: Object)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır