Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System / compmod / system / codedom / CodeAttributeArgument.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="CodeAttributeArgument.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 an argument for use in a custom attribute declaration.
20     ///    </para>
21     /// </devdoc>
22     [
23         ClassInterface(ClassInterfaceType.AutoDispatch),
24         ComVisible(true),
25         Serializable,
26     ]
27     public class CodeAttributeArgument {
28         private string name;
29         private CodeExpression value;
30
31         /// <devdoc>
32         ///    <para>
33         ///       Initializes a new instance of <see cref='System.CodeDom.CodeAttributeArgument'/>.
34         ///    </para>
35         /// </devdoc>
36         public CodeAttributeArgument() {
37         }
38
39         /// <devdoc>
40         ///    <para>
41         ///       Initializes a new instance of <see cref='System.CodeDom.CodeAttributeArgument'/> using the specified value.
42         ///    </para>
43         /// </devdoc>
44         public CodeAttributeArgument(CodeExpression value) {
45             Value = value;
46         }
47
48         /// <devdoc>
49         ///    <para>
50         ///       Initializes a new instance of <see cref='System.CodeDom.CodeAttributeArgument'/> using the specified name and
51         ///       value.
52         ///    </para>
53         /// </devdoc>
54         public CodeAttributeArgument(string name, CodeExpression value) {
55             Name = name;
56             Value = value;
57         }
58
59         /// <devdoc>
60         ///    <para>
61         ///       The name of the attribute.
62         ///    </para>
63         /// </devdoc>
64         public string Name {
65             get {
66                 return (name == null) ? string.Empty : name;
67             }
68             set {
69                 name = value;
70             }
71         }
72
73         /// <devdoc>
74         ///    <para>
75         ///       The argument for the attribute.
76         ///    </para>
77         /// </devdoc>
78         public CodeExpression Value {
79             get {
80                 return value;
81             }
82             set {
83                 this.value = value;
84             }
85         }
86     }
87 }