Updates referencesource to .NET 4.7
[mono-project.git] / mcs / class / referencesource / System / compmod / system / codedom / CodeMemberField.cs
blob0a6d89bcfbcfbf931bf2a09094ff7f28a78c5b0a
1 //------------------------------------------------------------------------------
2 // <copyright file="CodeMemberField.cs" company="Microsoft">
3 //
4 // <OWNER>Microsoft</OWNER>
5 // Copyright (c) Microsoft Corporation. All rights reserved.
6 // </copyright>
7 //------------------------------------------------------------------------------
9 namespace System.CodeDom {
11 using System.Diagnostics;
12 using System;
13 using Microsoft.Win32;
14 using System.Collections;
15 using System.Runtime.InteropServices;
17 /// <devdoc>
18 /// <para>
19 /// Represents a class field member.
20 /// </para>
21 /// </devdoc>
23 ClassInterface(ClassInterfaceType.AutoDispatch),
24 ComVisible(true),
25 Serializable,
27 public class CodeMemberField : CodeTypeMember {
28 private CodeTypeReference type;
29 private CodeExpression initExpression;
31 /// <devdoc>
32 /// <para>
33 /// Initializes a new <see cref='System.CodeDom.CodeMemberField'/>.
34 /// </para>
35 /// </devdoc>
36 public CodeMemberField() {
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;
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;
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;
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("");
76 return type;
78 set {
79 type = value;
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;
92 set {
93 initExpression = value;