System.CodeDom.CodeDelegateCreateExpression Class

Represents an expression that creates a delegate.

See Also: CodeDelegateCreateExpression Members

Syntax

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
public class CodeDelegateCreateExpression : CodeExpression

Remarks

System.CodeDom.CodeDelegateCreateExpression represents code that creates a delegate. System.CodeDom.CodeDelegateCreateExpression is often used with System.CodeDom.CodeAttachEventStatement or System.CodeDom.CodeRemoveEventStatement to represent an event handler to attach or remove from an event.

The CodeDelegateCreateExpression.DelegateType property specifies the type of delegate to create. The CodeDelegateCreateExpression.TargetObject property indicates the object that contains the event-handler method. The CodeDelegateCreateExpression.MethodName property indicates the name of the event-handler method whose method signature matches the method signature of the delegate.

In C#, a delegate creation expression is typically of the following form: new EventHandler(this.HandleEventMethod). In Visual Basic, a delegate creation expression is typically of the following form: AddressOf Me.HandleEventMethod.

Requirements

Namespace: System.CodeDom
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0, 4.0.0.0