2 // FlatButtonAppearance.cs
4 // Permission is hereby granted, free of charge, to any person obtaining
5 // a copy of this software and associated documentation files (the
6 // "Software"), to deal in the Software without restriction, including
7 // without limitation the rights to use, copy, modify, merge, publish,
8 // distribute, sublicense, and/or sell copies of the Software, and to
9 // permit persons to whom the Software is furnished to do so, subject to
10 // the following conditions:
12 // The above copyright notice and this permission notice shall be
13 // included in all copies or substantial portions of the Software.
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 // Copyright (c) 2006 Daniel Nauck
26 // Daniel Nauck (dna(at)mono-project(dot)de)
30 using System.ComponentModel;
32 using System.Windows.Forms;
34 namespace System.Windows.Forms
39 class FlatButtonAppearance
41 private Color borderColor = Color.Empty;
42 private int borderSize = 1;
43 private Color checkedBackColor = Color.Empty;
44 private Color mouseDownBackColor = Color.Empty;
45 private Color mouseOverBackColor = Color.Empty;
46 private ButtonBase owner = null;
48 internal FlatButtonAppearance (ButtonBase owner)
53 [EditorBrowsable(EditorBrowsableState.Always)]
54 [DefaultValue(typeof(Color), "")]
55 [NotifyParentProperty(true)]
57 public Color BorderColor
59 get { return borderColor; }
61 if(borderColor == value)
71 [EditorBrowsable(EditorBrowsableState.Always)]
73 [NotifyParentProperty(true)]
77 get { return borderSize; }
79 if(borderSize == value)
83 throw new ArgumentOutOfRangeException ("value", string.Format ("'{0}' is not a valid value for 'BorderSize'. 'BorderSize' must be greater or equal than {1}.", value, 0));
92 [EditorBrowsable(EditorBrowsableState.Always)]
93 [DefaultValue(typeof(Color), "")]
94 [NotifyParentProperty(true)]
96 public Color CheckedBackColor
98 get { return checkedBackColor; }
100 if(checkedBackColor == value)
103 checkedBackColor = value;
110 [EditorBrowsable(EditorBrowsableState.Always)]
111 [DefaultValue(typeof(Color), "")]
113 [NotifyParentProperty(true)]
114 public Color MouseDownBackColor
116 get { return mouseDownBackColor; }
118 if(mouseDownBackColor == value)
121 mouseDownBackColor = value;
128 [EditorBrowsable(EditorBrowsableState.Always)]
129 [DefaultValue(typeof(Color), "")]
130 [NotifyParentProperty(true)]
132 public Color MouseOverBackColor
134 get { return mouseOverBackColor; }
136 if(mouseOverBackColor == value)
139 mouseOverBackColor = value;