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)
31 using System.ComponentModel;
33 using System.Windows.Forms;
35 namespace System.Windows.Forms
37 public class FlatButtonAppearance
39 private Color borderColor = Color.Empty;
40 private int borderSize = 1;
41 private Color checkedBackColor = Color.Empty;
42 private Color mouseDownBackColor = Color.Empty;
43 private Color mouseOverBackColor = Color.Empty;
44 private ButtonBase owner = null;
46 internal FlatButtonAppearance (ButtonBase owner)
51 [EditorBrowsable(EditorBrowsableState.Always)]
52 [DefaultValue(typeof(Color), "")]
53 [NotifyParentProperty(true)]
55 public Color BorderColor
57 get { return borderColor; }
59 if(borderColor == value)
69 [EditorBrowsable(EditorBrowsableState.Always)]
71 [NotifyParentProperty(true)]
75 get { return borderSize; }
77 if(borderSize == value)
81 throw new ArgumentOutOfRangeException ("value", string.Format ("'{0}' is not a valid value for 'BorderSize'. 'BorderSize' must be greater or equal than {1}.", value, 0));
90 [EditorBrowsable(EditorBrowsableState.Always)]
91 [DefaultValue(typeof(Color), "")]
92 [NotifyParentProperty(true)]
94 public Color CheckedBackColor
96 get { return checkedBackColor; }
98 if(checkedBackColor == value)
101 checkedBackColor = value;
108 [EditorBrowsable(EditorBrowsableState.Always)]
109 [DefaultValue(typeof(Color), "")]
111 [NotifyParentProperty(true)]
112 public Color MouseDownBackColor
114 get { return mouseDownBackColor; }
116 if(mouseDownBackColor == value)
119 mouseDownBackColor = value;
126 [EditorBrowsable(EditorBrowsableState.Always)]
127 [DefaultValue(typeof(Color), "")]
128 [NotifyParentProperty(true)]
130 public Color MouseOverBackColor
132 get { return mouseOverBackColor; }
134 if(mouseOverBackColor == value)
137 mouseOverBackColor = value;