+2007-05-19 Marek Safar <marek.safar@gmail.com>
+
+ * Theme.cs (GetHatchBrush): A key uses internal value instead of formated
+ enum value.
+
2007-05-19 Andreia Gaita <avidigal@novell.com>
* NumericUpDown.cs: Added 2.0 methods (spin acceleration)
public HatchBrush GetHatchBrush (HatchStyle hatchStyle, Color foreColor, Color backColor)
{
- string hash = hatchStyle.ToString () + foreColor.ToString () + backColor.ToString ();
+ string hash = ((int)hatchStyle).ToString () + foreColor.ToString () + backColor.ToString ();
lock (hatchbrushes) {
- if (hatchbrushes.Contains (hash))
- return (HatchBrush) hatchbrushes[hash];
-
- HatchBrush brush = new HatchBrush (hatchStyle, foreColor, backColor);
- hatchbrushes.Add (hash, brush);
+ HatchBrush brush = (HatchBrush) hatchbrushes[hash];
+ if (brush == null) {
+ brush = new HatchBrush (hatchStyle, foreColor, backColor);
+ hatchbrushes.Add (hash, brush);
+ }
return brush;
}
}