CodeMethodInvokeExpression Class
.NET Framework 2.0
Represents an expression that invokes a method.
Namespace: System.CodeDom
Assembly: System (in system.dll)
Assembly: System (in system.dll)
'Declaration <SerializableAttribute> _ <ComVisibleAttribute(True)> _ <ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ Public Class CodeMethodInvokeExpression Inherits CodeExpression 'Usage Dim instance As CodeMethodInvokeExpression
/** @attribute SerializableAttribute() */ /** @attribute ComVisibleAttribute(true) */ /** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ public class CodeMethodInvokeExpression extends CodeExpression
SerializableAttribute ComVisibleAttribute(true) ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) public class CodeMethodInvokeExpression extends CodeExpression
Not applicable.
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)
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(
System.Convert.ToString(true)) });
// A VJ# code generator produces the following source code for the
// preceeding example code:
// this.Dispose(true);
System.Object
System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeMethodInvokeExpression
System.CodeDom.CodeObject
System.CodeDom.CodeExpression
System.CodeDom.CodeMethodInvokeExpression
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: