CodeMethodInvokeExpression Class
Represents an expression that invokes a method.
Assembly: System (in System.dll)
CodeMethodInvokeExpression can be used to represent an expression that invokes a method.
The Method property specifies the method to invoke. The Parameters property indicates the parameters to pass to the method. Use a CodeDirectionExpression to specify the field direction of a parameter.
This example demonstrates using a CodeMethodInvokeExpression to invoke a method.
' 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)
System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeMethodInvokeExpression
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.