Aracılığıyla paylaş


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 örnek, bir yöntemi çağırmak için bir kullanmayı CodeMethodInvokeExpression gösterir.

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 kullanın.

Oluşturucular

Name Description
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ın yeni bir örneğini CodeMethodInvokeExpression başlatır.

Özellikler

Name Description
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

Name Description
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()

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

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

Geçerli Objectbasit bir kopyasını oluşturur.

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

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

(Devralındığı yer: Object)

Şunlara uygulanır

Ayrıca bkz.