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 メソッドを呼び出す方法を示します。

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)

注釈

CodeMethodInvokeExpression を使用して、メソッドを呼び出す式を表すことができます。

プロパティは Method 、呼び出すメソッドを指定します。 プロパティは Parameters 、 メソッドに渡すパラメーターを示します。 パラメーターの CodeDirectionExpression フィールド方向を指定するには、 を使用します。

コンストラクター

CodeMethodInvokeExpression()

CodeMethodInvokeExpression クラスの新しいインスタンスを初期化します。

CodeMethodInvokeExpression(CodeExpression, String, CodeExpression[])

対象オブジェクト、メソッド名、およびパラメーターを指定して、CodeMethodInvokeExpression クラスの新しいインスタンスを初期化します。

CodeMethodInvokeExpression(CodeMethodReferenceExpression, CodeExpression[])

メソッドとパラメーターを指定して、CodeMethodInvokeExpression クラスの新しいインスタンスを初期化します。

プロパティ

Method

呼び出されるメソッドを取得または設定します。

Parameters

メソッドの呼び出しに使用するパラメーターを取得します。

UserData

現在のオブジェクトのユーザー定義可能なデータを取得します。

(継承元 CodeObject)

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください