1 //------------------------------------------------------------------------------
2 // <copyright file="CodeDelegateCreateExpression.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.Runtime.InteropServices;
19 /// Represents a delegate creation expression.
23 ClassInterface(ClassInterfaceType.AutoDispatch),
27 public class CodeDelegateCreateExpression : CodeExpression {
28 private CodeTypeReference delegateType;
29 private CodeExpression targetObject;
30 private string methodName;
34 /// Initializes a new instance of <see cref='System.CodeDom.CodeDelegateCreateExpression'/>.
37 public CodeDelegateCreateExpression() {
42 /// Initializes a new instance of <see cref='System.CodeDom.CodeDelegateCreateExpression'/>.
45 public CodeDelegateCreateExpression(CodeTypeReference delegateType, CodeExpression targetObject, string methodName) {
46 this.delegateType = delegateType;
47 this.targetObject = targetObject;
48 this.methodName = methodName;
53 /// Gets or sets the delegate type.
56 public CodeTypeReference DelegateType {
58 if (delegateType == null) {
59 delegateType = new CodeTypeReference("");
70 /// Gets or sets the target object.
73 public CodeExpression TargetObject {
84 /// Gets or sets the method name.
87 public string MethodName {
89 return (methodName == null) ? string.Empty : methodName;