In mono_thread_info_suspend_lock in non-coop, don't assert MonoThreadInfo* is non...
[mono.git] / mcs / class / System.Drawing / System.Drawing / SolidBrush.cs
index 4e2f5fa58bc8f91113a69cc318017a6220d794ad..f356be3d26a523bcc3fa7a693628c6a3da393f13 100644 (file)
@@ -7,11 +7,7 @@
 //   Ravindra (rkumar@novell.com)
 //
 // (C) 2002 Ximian, Inc.
-// (C) 2004 Novell, Inc.
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2007 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-using System;
 
-namespace System.Drawing
-{
+namespace System.Drawing {
+
        public sealed class SolidBrush : Brush {
                
                internal bool isModifiable = true;
+               // we keep this cached because calling GdipGetSolidFillColor 
+               // wouldn't return a "named" color like SD is expected to do
                private Color color;
 
                 internal SolidBrush (IntPtr ptr)
@@ -68,27 +65,25 @@ namespace System.Drawing
                                        GDIPlus.CheckStatus (status);
                                }
                                else
-                                       throw new ArgumentException ("This SolidBrush object can't be modified.");
+                                       throw new ArgumentException (Locale.GetText ("This SolidBrush object can't be modified."));
                        }
                }
                
-               public override object Clone()
+               public override object Clone ()
                {
                        IntPtr clonePtr;
                        Status status = GDIPlus.GdipCloneBrush (nativeObject, out clonePtr);
                        GDIPlus.CheckStatus (status);
-       
+                       // we loose the named color in this case (but so does MS SD)
                        return new SolidBrush (clonePtr);
                }
                
                protected override void Dispose (bool disposing)
                {
-                       if (disposing == true && isModifiable == false) {
-                               throw new ArgumentException ("This SolidBrush object can't be modified.");
-                       }
+                       if (disposing && !isModifiable)
+                               throw new ArgumentException (Locale.GetText ("This SolidBrush object can't be modified."));
 
                        base.Dispose (disposing); 
                }
        }
 }
-