Added missing attributes to relevent classes and corrected coding style mistakes...
[mono.git] / mcs / class / System.Drawing / System.Drawing / SystemBrushes.cs
1 //
2 // System.Drawing.SystemBrushes.cs
3 //
4 // Author:
5 //   Dennis Hayes (dennish@Raytek.com)
6 //
7 // (C) 2002 Ximian, Inc
8 //
9 using System;
10
11 namespace System.Drawing
12 {
13         /// <summary>
14         /// Summary description for SystemBrushes.
15         /// </summary>
16         public sealed class SystemBrushes
17         {
18                 static SolidBrush active_border;
19                 static SolidBrush active_caption;
20                 static SolidBrush active_caption_text;
21                 static SolidBrush app_workspace;
22                 static SolidBrush control;
23                 static SolidBrush control_dark;
24                 static SolidBrush control_dark_dark;
25                 static SolidBrush control_light;
26                 static SolidBrush control_light_light;
27                 static SolidBrush control_text;
28                 static SolidBrush desktop;
29                 static SolidBrush highlight;
30                 static SolidBrush highlight_text;
31                 static SolidBrush hot_track;
32                 static SolidBrush inactive_border;
33                 static SolidBrush inactive_caption;
34                 static SolidBrush info;
35                 static SolidBrush menu;
36                 static SolidBrush scroll_bar;
37                 static SolidBrush window;
38                 static SolidBrush window_text;
39
40                 private SystemBrushes()
41                 {
42                 }
43
44                 public static Brush ActiveBorder
45                 {       
46                         get {
47                                 if (active_border == null) {
48                                         active_border = new SolidBrush (SystemColors.ActiveBorder);
49                                         active_border.isModifiable = false;
50                                 }
51
52                                 return active_border;
53                         }
54                 }
55
56                 public static Brush ActiveCaption
57                 {       
58                         get {
59                                 if (active_caption == null) {
60                                         active_caption = new SolidBrush (SystemColors.ActiveCaption);
61                                         active_caption.isModifiable = false;
62                                 }
63
64                                 return active_caption;
65                         }
66                 }
67
68                 public static Brush ActiveCaptionText
69                 {       
70                         get {
71                                 if (active_caption_text == null) {
72                                         active_caption_text = new SolidBrush (SystemColors.ActiveCaptionText);
73                                         active_caption_text.isModifiable = false;
74                                 }
75
76                                 return active_caption_text;
77                         }
78                 }
79
80                 public static Brush AppWorkspace
81                 {       
82                         get {
83                                 if (app_workspace == null) {
84                                         app_workspace = new SolidBrush (SystemColors.AppWorkspace);
85                                         app_workspace.isModifiable = false;
86                                 }
87
88                                 return app_workspace;
89                         }
90                 }
91
92                 public static Brush Control {
93                         get {
94                                 if (control == null) {
95                                         control = new SolidBrush (SystemColors.Control);
96                                         control.isModifiable = false;
97                                 }
98
99                                 return control;
100                         }
101                 }
102                 
103                 public static Brush ControlLight {
104                         get {
105                                 if (control_light == null) {
106                                         control_light = new SolidBrush (SystemColors.ControlLight);
107                                         control_light.isModifiable = false;
108                                 }
109
110                                 return control_light;
111                         }
112                 }
113                 
114                 public static Brush ControlLightLight {
115                         get {
116                                 if (control_light_light == null) {
117                                         control_light_light = new SolidBrush (SystemColors.ControlLightLight);
118                                         control_light_light.isModifiable = false;
119                                 }
120
121                                 return control_light_light;
122                         }
123                 }
124
125                 public static Brush ControlDark {
126                         get {
127                                 if (control_dark == null) {
128                                         control_dark = new SolidBrush (SystemColors.ControlDark);
129                                         control_dark.isModifiable = false;
130                                 }
131
132                                 return control_dark;
133                         }
134                 }
135                 
136                 public static Brush ControlDarkDark {
137                         get {
138                                 if (control_dark_dark == null) {
139                                         control_dark_dark = new SolidBrush (SystemColors.ControlDarkDark);
140                                         control_dark_dark.isModifiable = false;
141                                 }
142
143                                 return control_dark_dark;
144                         }
145                 }
146
147                 public static Brush ControlText {
148                         get {
149                                 if (control_text == null) {
150                                         control_text = new SolidBrush (SystemColors.ControlText);
151                                         control_text.isModifiable = false;
152                                 }
153
154                                 return control_text;
155                         }
156                 }
157
158                 public static Brush Highlight {
159                         get {
160                                 if (highlight == null) {
161                                         highlight = new SolidBrush (SystemColors.Highlight);
162                                         highlight.isModifiable = false;
163                                 }
164
165                                 return highlight;
166                         }
167                 }
168
169                 public static Brush HighlightText {
170                         get {
171                                 if (highlight_text == null) {
172                                         highlight_text = new SolidBrush (SystemColors.HighlightText);
173                                         highlight_text.isModifiable = false;
174                                 }
175
176                                 return highlight_text;
177                         }
178                 }
179
180                 public static Brush Window {
181                         get {
182                                 if (window == null) {
183                                         window = new SolidBrush (SystemColors.Window);
184                                         window.isModifiable = false;
185                                 }
186
187                                 return window;
188                         }
189                 }
190                 public static Brush WindowText {
191                         get {
192                                 if (window_text == null) {
193                                         window_text = new SolidBrush (SystemColors.WindowText);
194                                         window_text.isModifiable = false;
195                                 }
196
197                                 return window_text;
198                         }
199                 }
200
201                 public static Brush InactiveBorder {
202                         get {
203                                 if (inactive_border == null) {
204                                         inactive_border = new SolidBrush (SystemColors.InactiveBorder);
205                                         inactive_border.isModifiable = false;
206                                 }
207
208                                 return inactive_border;
209                         }
210                 }
211
212                 public static Brush Desktop {
213                         get {
214                                 if (desktop == null) {
215                                         desktop = new SolidBrush (SystemColors.Desktop);
216                                         desktop.isModifiable = false;
217                                 }
218
219                                 return desktop;
220                         }
221                 }
222
223                 public static Brush HotTrack {
224                         get {
225                                 if (hot_track == null) {
226                                         hot_track = new SolidBrush (SystemColors.HotTrack);
227                                         hot_track.isModifiable = false;
228                                 }
229
230                                 return hot_track;
231                         }
232                 }
233
234                 public static Brush InactiveCaption {
235                         get {
236                                 if (inactive_caption == null) {
237                                         inactive_caption = new SolidBrush (SystemColors.InactiveCaption);
238                                         inactive_caption.isModifiable = false;
239                                 }
240
241                                 return inactive_caption;
242                         }
243                 }
244                 
245                 public static Brush Info {
246                         get {
247                                 if (info == null) {
248                                         info = new SolidBrush (SystemColors.Info);
249                                         info.isModifiable = false;
250                                 }
251
252                                 return info;
253                         }
254                 }
255                 
256                 public static Brush Menu {
257                         get {
258                                 if (menu == null) {
259                                         menu = new SolidBrush (SystemColors.Menu);
260                                         menu.isModifiable = false;
261                                 }
262
263                                 return menu;
264                         }
265                 }
266                 
267                 public static Brush ScrollBar {
268                         get {
269                                 if (scroll_bar == null) {
270                                         scroll_bar = new SolidBrush (SystemColors.ScrollBar);
271                                         scroll_bar.isModifiable = false;
272                                 }
273
274                                 return scroll_bar;
275                         }
276                 }
277
278                 public static Brush FromSystemColor (Color c) 
279                 {
280                         if (c.IsSystemColor) {
281                                 SolidBrush newBrush = new SolidBrush (c);
282                                 newBrush.isModifiable = false;
283                                 return newBrush;
284                         }
285
286                         String message = String.Format ("The color {0} is not a system color.", c);
287                         throw new ArgumentException (message);
288                 }
289         }
290 }