97b3f36b823f6eff2c825f6cb4c0d357eb273e2e
[mono.git] / mcs / class / referencesource / System / compmod / system / codedom / CodePropertyReferenceExpression.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="CodePropertyReferenceExpression.cs" company="Microsoft">
3 // 
4 // <OWNER>Microsoft</OWNER>
5 //     Copyright (c) Microsoft Corporation.  All rights reserved.
6 // </copyright>                                                                
7 //------------------------------------------------------------------------------
8
9 namespace System.CodeDom {
10
11     using System.Diagnostics;
12     using System;
13     using Microsoft.Win32;
14     using System.Collections;
15     using System.Runtime.InteropServices;
16
17     /// <devdoc>
18     ///    <para>
19     ///       Represents a reference to a property.
20     ///    </para>
21     /// </devdoc>
22     [
23         ClassInterface(ClassInterfaceType.AutoDispatch),
24         ComVisible(true),
25         Serializable,
26     ]
27     public class CodePropertyReferenceExpression : CodeExpression {
28         private CodeExpression targetObject;
29         private string propertyName;
30         private CodeExpressionCollection parameters = new CodeExpressionCollection();
31
32         /// <devdoc>
33         ///    <para>
34         ///       Initializes a new instance of <see cref='System.CodeDom.CodePropertyReferenceExpression'/>.
35         ///    </para>
36         /// </devdoc>
37         public CodePropertyReferenceExpression() {
38         }
39
40         /// <devdoc>
41         ///    <para>
42         ///       Initializes a new instance of <see cref='System.CodeDom.CodePropertyReferenceExpression'/> using the specified target object and property
43         ///       name.
44         ///    </para>
45         /// </devdoc>
46         public CodePropertyReferenceExpression(CodeExpression targetObject, string propertyName) {
47             TargetObject = targetObject;
48             PropertyName = propertyName;
49         }
50
51         /// <devdoc>
52         ///    <para>
53         ///       The target object containing the property this <see cref='System.CodeDom.CodePropertyReferenceExpression'/> references.
54         ///    </para>
55         /// </devdoc>
56         public CodeExpression TargetObject {
57             get {
58                 return targetObject;
59             }
60             set {
61                 targetObject = value;
62             }
63         }
64
65         /// <devdoc>
66         ///    <para>
67         ///       The name of the property to reference.
68         ///    </para>
69         /// </devdoc>
70         public string PropertyName {
71             get {
72                 return (propertyName == null) ? string.Empty : propertyName;
73             }
74             set {
75                 propertyName = value;
76             }
77         }
78     }
79 }