System.CodeDom.CodeTypeDelegate Class

Represents a delegate declaration.

See Also: CodeTypeDelegate Members

Syntax

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

Remarks

System.CodeDom.CodeTypeDelegate can be used to declare a delegate type, or event handler. A delegate defines a method signature that can be used by calback methods or event handlers. Delegates can be declared at the namespace level or nested inside other types. Delegates cannot be nested inside other delegates.

The CodeTypeDelegate.ReturnType property specifies the data type of the event handler returned by the delegate. The CodeTypeDelegate.Parameters property contains the parameters for the delegate type.

System.CodeDom.CodeTypeDelegate should not be used for enumeration, interface, or type declaration. Instead, use System.CodeDom.CodeTypeDeclaration for those.

Note:

Not all languages support the declaration of delegates. Call the System.CodeDom.Compiler.ICodeGenerator.Supports(System.CodeDom.Compiler.GeneratorSupport) method with the System.CodeDom.Compiler.GeneratorSupport.DeclareDelegates flag to determine if it is supported in a particular language.

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