System.CodeDom.CodeTypeDelegate Class

Represents a delegate declaration.

See Also: CodeTypeDelegate Members


public class CodeTypeDelegate : CodeTypeDeclaration


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.


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.


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