1 //------------------------------------------------------------------------------
2 // <copyright file="CodeTypeDelegate.cs" company="Microsoft">
4 // <OWNER>Microsoft</OWNER>
5 // Copyright (c) Microsoft Corporation. All rights reserved.
7 //------------------------------------------------------------------------------
9 namespace System.CodeDom {
11 using System.Diagnostics;
13 using Microsoft.Win32;
14 using System.Collections;
15 using System.Reflection;
16 using System.Runtime.InteropServices;
17 using System.Runtime.Serialization;
21 /// Represents a class or nested class.
25 ClassInterface(ClassInterfaceType.AutoDispatch),
29 public class CodeTypeDelegate : CodeTypeDeclaration {
30 private CodeParameterDeclarationExpressionCollection parameters = new CodeParameterDeclarationExpressionCollection();
31 private CodeTypeReference returnType;
35 /// Initializes a new instance of <see cref='System.CodeDom.CodeTypeDelegate'/>.
38 public CodeTypeDelegate() {
39 TypeAttributes &= ~TypeAttributes.ClassSemanticsMask;
40 TypeAttributes |= TypeAttributes.Class;
42 BaseTypes.Add(new CodeTypeReference("System.Delegate"));
47 /// Initializes a new instance of <see cref='System.CodeDom.CodeTypeDelegate'/>.
50 public CodeTypeDelegate(string name) : this() {
56 /// Gets or sets the return type of the delegate.
59 public CodeTypeReference ReturnType {
61 if (returnType == null) {
62 returnType = new CodeTypeReference("");
73 /// The parameters of the delegate.
76 public CodeParameterDeclarationExpressionCollection Parameters {