diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2008-11-02 03:46:24 +0300 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2008-11-02 03:46:24 +0300 |
commit | 07be13d622fb7d789931c60fca5757aed7fea2ce (patch) | |
tree | f891973e2c15f3e1fd5dcfaa4556d62199e1a879 /mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs | |
parent | 54587bcdea61a2b9ad3371205f0198d595b602bf (diff) |
2008-11-01 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathIterator.cs: Add proper null check that match the same
behavior that MS has.
* LinearGradientBrush.cs: Add comments to setter that dont do any null
check in order to be compatible with MS. Fix InterpolationColors to
throw a ArgumentNullException.
* PathGradientBrush.cs: Add comments to setter that dont do any null
check in order to be compatible with MS.
[Found using Gendarme CheckParametersNullityInVisibleMethodsRule]
svn path=/trunk/mcs/; revision=117627
Diffstat (limited to 'mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs')
-rw-r--r-- | mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs index 45cb9bb9f31..aa8fcf55e0b 100644 --- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs +++ b/mcs/class/System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs @@ -119,6 +119,7 @@ namespace System.Drawing.Drawing2D { return blend; } set { + // no null check, MS throws a NullReferenceException here int count; float [] factors = value.Factors; float [] positions = value.Positions; @@ -175,6 +176,8 @@ namespace System.Drawing.Drawing2D { return interpolationColors; } set { + if (value == null) + throw new ArgumentException ("InterpolationColors is null"); int count; Color [] colors = value.Colors; float [] positions = value.Positions; @@ -213,6 +216,7 @@ namespace System.Drawing.Drawing2D { return linearColors; } set { + // no null check, MS throws a NullReferenceException here Status status = GDIPlus.GdipSetLineColors (nativeObject, value [0].ToArgb (), value [1].ToArgb ()); GDIPlus.CheckStatus (status); } |