Added new files from Martin Adoue <martin@cwanet.com>
[mono.git] / mcs / class / System / System.ComponentModel / DefaultValueAttribute.cs
1 using System;\r
2 \r
3 namespace System.ComponentModel\r
4 {\r
5         /// <summary>\r
6         /// Specifies the default value for a property.\r
7         /// </summary>\r
8 \r
9         [MonoTODO("Needs testing. DefaultValueAttribute(System.Type type, string value) is not implemented. Value has no description.")]\r
10         [AttributeUsage(AttributeTargets.Parameter)]\r
11         public sealed class DefaultValueAttribute : Attribute\r
12         {\r
13 \r
14                 private object defaultValue;\r
15 \r
16                 /// <summary>\r
17                 /// FIXME: Summary description for Value.\r
18                 /// </summary>\r
19                 public object Value\r
20                 {\r
21                         get \r
22                         {\r
23                                 return defaultValue;\r
24                         }\r
25                 }\r
26 \r
27                 /// <summary>\r
28                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class.\r
29                 /// </summary>\r
30                 /// <param name="value">An System.Object that represents the default value.</param>\r
31                 public DefaultValueAttribute(object value)\r
32                 {\r
33                         defaultValue = value;\r
34                 }\r
35 \r
36                 /// <summary>\r
37                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a System.Boolean value.\r
38                 /// </summary>\r
39                 /// <param name="value">An System.Boolean that represents the default value.</param>\r
40                 public DefaultValueAttribute(bool value)\r
41                 {\r
42                         defaultValue = value;\r
43                 }\r
44 \r
45 \r
46                 /// <summary>\r
47                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using an 8-bit unsigned integer.\r
48                 /// </summary>\r
49                 /// <param name="value">An 8-bit unsigned integer that is the default value.</param>\r
50                 public DefaultValueAttribute(byte value)\r
51                 {\r
52                         defaultValue = value;\r
53                 }\r
54 \r
55                 /// <summary>\r
56                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a Unicode character.\r
57                 /// </summary>\r
58                 /// <param name="value">A Unicode character that is the default value.</param>\r
59                 public DefaultValueAttribute(char value)\r
60                 {\r
61                         defaultValue = value;\r
62                 }\r
63 \r
64                 /// <summary>\r
65                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a double-precision floating point number.\r
66                 /// </summary>\r
67                 /// <param name="value">A double-precision floating point number that is the default value.</param>\r
68                 public DefaultValueAttribute(double value)\r
69                 {\r
70                         defaultValue = value;\r
71                 }\r
72 \r
73                 /// <summary>\r
74                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a 32-bit signed integer.\r
75                 /// </summary>\r
76                 /// <param name="value">A 32-bit signed integer that is the default value.</param>\r
77                 public DefaultValueAttribute(int value)\r
78                 {\r
79                         defaultValue = value;\r
80                 }\r
81 \r
82                 /// <summary>\r
83                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a 64-bit signed integer.\r
84                 /// </summary>\r
85                 /// <param name="value">A 64-bit signed integer that is the default value.</param>\r
86                 public DefaultValueAttribute(long value)\r
87                 {\r
88                         defaultValue = value;\r
89                 }\r
90 \r
91                 /// <summary>\r
92                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a 16-bit signed integer.\r
93                 /// </summary>\r
94                 /// <param name="value">A 16-bit signed integer that is the default value.</param>\r
95                 public DefaultValueAttribute(short value)\r
96                 {\r
97                         defaultValue = value;\r
98                 }\r
99 \r
100                 /// <summary>\r
101                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a single-precision floating point number.\r
102                 /// </summary>\r
103                 /// <param name="value">A single-precision floating point number that is the default value.</param>\r
104                 public DefaultValueAttribute(System.Single value)\r
105                 {\r
106                         defaultValue = value;\r
107                 }\r
108 \r
109                 /// <summary>   \r
110                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class using a System.String.\r
111                 /// </summary>\r
112                 /// <param name="value">A System.String that is the default value.</param>\r
113                 public DefaultValueAttribute(string value)\r
114                 {\r
115                         defaultValue = value;\r
116                 }\r
117 \r
118                 /*\r
119                 /// <summary>   \r
120                 /// Initializes a new instance of the System.ComponentModel.DefaultValueAttribute class, converting the specified value to the specified type, and using an invariant culture as the translation context.\r
121                 /// </summary>\r
122                 /// <param name="type">A System.Type that represents the type to convert the value to.</param>\r
123                 /// <param name="value">A System.String that can be converted to the type using the System.ComponentModel.TypeConverter for the type and the U.S. English culture.</param>\r
124                 public DefaultValueAttribute(System.Type type, string value)\r
125                 {\r
126                         //FIXME\r
127                         throw new NotImplementedException(); \r
128                 }\r
129                 */\r
130         }\r
131 \r
132 }\r
133 \r