X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Drawing%2FSystem.Drawing%2FSolidBrush.cs;h=f356be3d26a523bcc3fa7a693628c6a3da393f13;hb=fe8bdbcef723fc8c92afcc822aa4c12e34c21c0b;hp=4e2f5fa58bc8f91113a69cc318017a6220d794ad;hpb=f99ce750ee781a2584e849a0264300fa4d99aaaa;p=mono.git diff --git a/mcs/class/System.Drawing/System.Drawing/SolidBrush.cs b/mcs/class/System.Drawing/System.Drawing/SolidBrush.cs index 4e2f5fa58bc..f356be3d26a 100644 --- a/mcs/class/System.Drawing/System.Drawing/SolidBrush.cs +++ b/mcs/class/System.Drawing/System.Drawing/SolidBrush.cs @@ -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 @@ -32,13 +28,14 @@ // 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); } } } -