Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System / compmod / system / codedom / CodeMemberField.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="CodeMemberField.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 class field member.
20     ///    </para>
21     /// </devdoc>
22     [
23         ClassInterface(ClassInterfaceType.AutoDispatch),
24         ComVisible(true),
25         Serializable,
26     ]
27     public class CodeMemberField : CodeTypeMember {
28         private CodeTypeReference type;
29         private CodeExpression initExpression;
30
31         /// <devdoc>
32         ///    <para>
33         ///       Initializes a new <see cref='System.CodeDom.CodeMemberField'/>.
34         ///    </para>
35         /// </devdoc>
36         public CodeMemberField() {
37         }
38
39         /// <devdoc>
40         ///    <para>
41         ///       Initializes a new <see cref='System.CodeDom.CodeMemberField'/> with the specified member field type and
42         ///       name.
43         ///    </para>
44         /// </devdoc>
45         public CodeMemberField(CodeTypeReference type, string name) {
46             Type = type;
47             Name = name;
48         }
49
50         /// <devdoc>
51         ///    <para>[To be supplied.]</para>
52         /// </devdoc>
53         public CodeMemberField(string type, string name) {
54             Type = new CodeTypeReference(type);
55             Name = name;
56         }
57
58         /// <devdoc>
59         ///    <para>[To be supplied.]</para>
60         /// </devdoc>
61         public CodeMemberField(Type type, string name) {
62             Type = new CodeTypeReference(type);
63             Name = name;
64         }
65
66         /// <devdoc>
67         ///    <para>
68         ///       Gets or sets the member field type.
69         ///    </para>
70         /// </devdoc>
71         public CodeTypeReference Type {
72             get {
73                 if (type == null) {
74                     type = new CodeTypeReference("");
75                 }
76                 return type;
77             }
78             set {
79                 type = value;
80             }
81         }
82
83         /// <devdoc>
84         ///    <para>
85         ///       Gets or sets the initialization expression for the member field.
86         ///    </para>
87         /// </devdoc>
88         public CodeExpression InitExpression {
89             get {
90                 return initExpression;
91             }
92             set {
93                 initExpression = value;
94             }
95         }
96     }
97 }