1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 
5 namespace System.CodeDom
6 {
7     [Serializable]
8     public class CodeMemberField : CodeTypeMember
9     {
10         private CodeTypeReference _type;
11 
CodeMemberField()12         public CodeMemberField() { }
13 
CodeMemberField(CodeTypeReference type, string name)14         public CodeMemberField(CodeTypeReference type, string name)
15         {
16             Type = type;
17             Name = name;
18         }
19 
CodeMemberField(string type, string name)20         public CodeMemberField(string type, string name)
21         {
22             Type = new CodeTypeReference(type);
23             Name = name;
24         }
25 
CodeMemberField(Type type, string name)26         public CodeMemberField(Type type, string name)
27         {
28             Type = new CodeTypeReference(type);
29             Name = name;
30         }
31 
32         public CodeTypeReference Type
33         {
34             get { return _type ?? (_type = new CodeTypeReference("")); }
35             set { _type = value; }
36         }
37 
38         public CodeExpression InitExpression { get; set; }
39     }
40 }
41