2 // System.Drawing.SystemBrushes.cs
5 // Dennis Hayes (dennish@Raytek.com)
7 // (C) 2002 Ximian, Inc
11 namespace System.Drawing
14 /// Summary description for SystemBrushes.
16 public sealed class SystemBrushes
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;
40 private SystemBrushes()
44 public static Brush ActiveBorder
47 if (active_border == null) {
48 active_border = new SolidBrush (SystemColors.ActiveBorder);
49 active_border.isModifiable = false;
56 public static Brush ActiveCaption
59 if (active_caption == null) {
60 active_caption = new SolidBrush (SystemColors.ActiveCaption);
61 active_caption.isModifiable = false;
64 return active_caption;
68 public static Brush ActiveCaptionText
71 if (active_caption_text == null) {
72 active_caption_text = new SolidBrush (SystemColors.ActiveCaptionText);
73 active_caption_text.isModifiable = false;
76 return active_caption_text;
80 public static Brush AppWorkspace
83 if (app_workspace == null) {
84 app_workspace = new SolidBrush (SystemColors.AppWorkspace);
85 app_workspace.isModifiable = false;
92 public static Brush Control {
94 if (control == null) {
95 control = new SolidBrush (SystemColors.Control);
96 control.isModifiable = false;
103 public static Brush ControlLight {
105 if (control_light == null) {
106 control_light = new SolidBrush (SystemColors.ControlLight);
107 control_light.isModifiable = false;
110 return control_light;
114 public static Brush ControlLightLight {
116 if (control_light_light == null) {
117 control_light_light = new SolidBrush (SystemColors.ControlLightLight);
118 control_light_light.isModifiable = false;
121 return control_light_light;
125 public static Brush ControlDark {
127 if (control_dark == null) {
128 control_dark = new SolidBrush (SystemColors.ControlDark);
129 control_dark.isModifiable = false;
136 public static Brush ControlDarkDark {
138 if (control_dark_dark == null) {
139 control_dark_dark = new SolidBrush (SystemColors.ControlDarkDark);
140 control_dark_dark.isModifiable = false;
143 return control_dark_dark;
147 public static Brush ControlText {
149 if (control_text == null) {
150 control_text = new SolidBrush (SystemColors.ControlText);
151 control_text.isModifiable = false;
158 public static Brush Highlight {
160 if (highlight == null) {
161 highlight = new SolidBrush (SystemColors.Highlight);
162 highlight.isModifiable = false;
169 public static Brush HighlightText {
171 if (highlight_text == null) {
172 highlight_text = new SolidBrush (SystemColors.HighlightText);
173 highlight_text.isModifiable = false;
176 return highlight_text;
180 public static Brush Window {
182 if (window == null) {
183 window = new SolidBrush (SystemColors.Window);
184 window.isModifiable = false;
190 public static Brush WindowText {
192 if (window_text == null) {
193 window_text = new SolidBrush (SystemColors.WindowText);
194 window_text.isModifiable = false;
201 public static Brush InactiveBorder {
203 if (inactive_border == null) {
204 inactive_border = new SolidBrush (SystemColors.InactiveBorder);
205 inactive_border.isModifiable = false;
208 return inactive_border;
212 public static Brush Desktop {
214 if (desktop == null) {
215 desktop = new SolidBrush (SystemColors.Desktop);
216 desktop.isModifiable = false;
223 public static Brush HotTrack {
225 if (hot_track == null) {
226 hot_track = new SolidBrush (SystemColors.HotTrack);
227 hot_track.isModifiable = false;
234 public static Brush InactiveCaption {
236 if (inactive_caption == null) {
237 inactive_caption = new SolidBrush (SystemColors.InactiveCaption);
238 inactive_caption.isModifiable = false;
241 return inactive_caption;
245 public static Brush Info {
248 info = new SolidBrush (SystemColors.Info);
249 info.isModifiable = false;
256 public static Brush Menu {
259 menu = new SolidBrush (SystemColors.Menu);
260 menu.isModifiable = false;
267 public static Brush ScrollBar {
269 if (scroll_bar == null) {
270 scroll_bar = new SolidBrush (SystemColors.ScrollBar);
271 scroll_bar.isModifiable = false;
278 public static Brush FromSystemColor (Color c)
280 if (c.IsSystemColor) {
281 SolidBrush newBrush = new SolidBrush (c);
282 newBrush.isModifiable = false;
286 String message = String.Format ("The color {0} is not a system color.", c);
287 throw new ArgumentException (message);