Share via


CodeMethodInvokeExpression Sınıf

Tanım

Bir yöntemi çağıran bir ifadeyi temsil eder.

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

Örnekler

Bu örnekte bir yöntemi çağırmak için bir CodeMethodInvokeExpression kullanımı gösterilmektedir.

array<CodeExpression^>^temp0 = {gcnew CodePrimitiveExpression( true )};

// parameters array contains the parameters for the method.
CodeMethodInvokeExpression^ methodInvoke = gcnew CodeMethodInvokeExpression( gcnew CodeThisReferenceExpression,"Dispose",temp0 );

// A C# code generator produces the following source code for the preceeding example code:
// this.Dispose(true);
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)

Açıklamalar

CodeMethodInvokeExpression bir yöntemi çağıran bir ifadeyi temsil etmek için kullanılabilir.

Method özelliği çağrılacak yöntemi belirtir. Parameters özelliği yöntemine geçirecek parametreleri gösterir. CodeDirectionExpression Parametrenin alan yönünü belirtmek için bir kullanın.

Oluşturucular

CodeMethodInvokeExpression()

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

CodeMethodInvokeExpression(CodeExpression, String, CodeExpression[])

Belirtilen hedef nesneyi, yöntem adını ve parametreleri kullanarak sınıfın yeni bir örneğini CodeMethodInvokeExpression başlatır.

CodeMethodInvokeExpression(CodeMethodReferenceExpression, CodeExpression[])

Belirtilen yöntemi ve parametreleri kullanarak sınıfın CodeMethodInvokeExpression yeni bir örneğini başlatır.

Özellikler

Method

Çağırmak için yöntemini alır veya ayarlar.

Parameters

yöntemini çağırmak için parametreleri 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

Ayrıca bkz.