New test.
[mono.git] / mcs / class / corlib / System.Diagnostics / DebuggerDisplayAttribute.cs
1 //
2 // System.Diagnostics.DebuggerDisplayAttribute.cs
3 //
4 // Author:
5 //   Chris Toshok (toshok@novell.com)
6 //
7
8 //
9 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System;
32
33 namespace System.Diagnostics {
34
35         [AttributeUsageAttribute(AttributeTargets.Class |
36                                  AttributeTargets.Struct |
37                                  AttributeTargets.Enum |
38                                  AttributeTargets.Field |
39                                  AttributeTargets.Delegate |
40                                  AttributeTargets.Property |
41                                  AttributeTargets.Assembly, AllowMultiple=true)]        
42 #if NET_2_0
43         public sealed class DebuggerDisplayAttribute : Attribute
44 #else
45         internal sealed class DebuggerDisplayAttribute : Attribute
46 #endif
47         {
48                 string value, type, name;
49                 string target_type_name;
50                 Type target_type;
51
52                 public DebuggerDisplayAttribute (string value) {
53                         this.value = value;
54                 }
55
56                 public string Value {
57                         get {
58                                 return value;
59                         }
60                 }
61
62                 public Type Target {
63                         get {
64                                 return target_type;
65                         }
66                         set {
67                                 target_type = value;
68                                 target_type_name = target_type.Name;
69                         }
70                 }
71
72                 public string TargetTypeName {
73                         get {
74                                 return target_type_name;
75                         }
76                         set {
77                                 target_type_name = value;
78                         }
79                 }
80
81                 public string Type {
82                         get {
83                                 return type;
84                         }
85
86                         set {
87                                 type = value;
88                         }
89                 }
90
91                 public string Name {
92                         get {
93                                 return name;
94                         }
95
96                         set {
97                                 type = name;
98                         }
99                 }
100         }
101
102 }