14
14
15
15
using System ;
16
16
using System . Collections . Generic ;
17
+ using System . Diagnostics ;
18
+ using System . Diagnostics . CodeAnalysis ;
17
19
using System . Text ;
18
20
19
21
namespace ImageMagick
@@ -100,8 +102,8 @@ public void Density(PointD value)
100
102
101
103
public void Dispose ( )
102
104
{
103
- if ( _NativeInstance != null )
104
- _NativeInstance . Dispose ( ) ;
105
+ Debug . Assert ( _NativeInstance != null ) ;
106
+ _NativeInstance . Dispose ( ) ;
105
107
}
106
108
107
109
public void Ellipse ( double originX , double originY , double radiusX , double radiusY , double startDegrees , double endDegrees )
@@ -154,21 +156,21 @@ public void Line(double startX, double startY, double endX, double endY)
154
156
_NativeInstance . Line ( startX , startY , endX , endY ) ;
155
157
}
156
158
159
+ [ SuppressMessage ( "Microsoft.Design" , "CA1062:Validate arguments of public methods" , MessageId = "0" , Justification = "Using assert instead." ) ]
157
160
public void PathArcAbs ( IEnumerable < PathArc > pathArcs )
158
161
{
159
- if ( pathArcs == null )
160
- return ;
162
+ Debug . Assert ( pathArcs != null ) ;
161
163
162
164
foreach ( PathArc pathArc in pathArcs )
163
165
{
164
166
_NativeInstance . PathArcAbs ( pathArc . X , pathArc . Y , pathArc . RadiusX , pathArc . RadiusY , pathArc . RotationX , pathArc . UseLargeArc , pathArc . UseSweep ) ;
165
167
}
166
168
}
167
169
170
+ [ SuppressMessage ( "Microsoft.Design" , "CA1062:Validate arguments of public methods" , MessageId = "0" , Justification = "Using assert instead." ) ]
168
171
public void PathArcRel ( IEnumerable < PathArc > pathArcs )
169
172
{
170
- if ( pathArcs == null )
171
- return ;
173
+ Debug . Assert ( pathArcs != null ) ;
172
174
173
175
foreach ( PathArc pathArc in pathArcs )
174
176
{
@@ -196,10 +198,10 @@ public void PathFinish()
196
198
_NativeInstance . PathFinish ( ) ;
197
199
}
198
200
201
+ [ SuppressMessage ( "Microsoft.Design" , "CA1062:Validate arguments of public methods" , MessageId = "0" , Justification = "Using assert instead." ) ]
199
202
public void PathLineToAbs ( IEnumerable < PointD > coordinates )
200
203
{
201
- if ( coordinates == null )
202
- return ;
204
+ Debug . Assert ( coordinates != null ) ;
203
205
204
206
foreach ( PointD coordinate in coordinates )
205
207
{
@@ -227,10 +229,10 @@ public void PathLineToVerticalAbs(double y)
227
229
_NativeInstance . PathLineToVerticalAbs ( y ) ;
228
230
}
229
231
232
+ [ SuppressMessage ( "Microsoft.Design" , "CA1062:Validate arguments of public methods" , MessageId = "0" , Justification = "Using assert instead." ) ]
230
233
public void PathLineToRel ( IEnumerable < PointD > coordinates )
231
234
{
232
- if ( coordinates == null )
233
- return ;
235
+ Debug . Assert ( coordinates != null ) ;
234
236
235
237
foreach ( PointD coordinate in coordinates )
236
238
{
@@ -290,8 +292,7 @@ public void Point(double x, double y)
290
292
291
293
public void Polygon ( IList < PointD > coordinates )
292
294
{
293
- if ( coordinates == null )
294
- return ;
295
+ Debug . Assert ( coordinates != null ) ;
295
296
296
297
using ( PointInfoCollection pointInfo = new PointInfoCollection ( coordinates ) )
297
298
{
@@ -301,8 +302,7 @@ public void Polygon(IList<PointD> coordinates)
301
302
302
303
public void Polyline ( IList < PointD > coordinates )
303
304
{
304
- if ( coordinates == null )
305
- return ;
305
+ Debug . Assert ( coordinates != null ) ;
306
306
307
307
using ( PointInfoCollection pointInfo = new PointInfoCollection ( coordinates ) )
308
308
{
@@ -380,10 +380,12 @@ public void StrokeColor(MagickColor color)
380
380
_NativeInstance . StrokeColor ( color ) ;
381
381
}
382
382
383
+ [ SuppressMessage ( "Microsoft.Design" , "CA1062:Validate arguments of public methods" , MessageId = "0" , Justification = "Using assert instead." ) ]
383
384
public void StrokeDashArray ( double [ ] dash )
384
385
{
385
- if ( dash != null )
386
- _NativeInstance . StrokeDashArray ( dash , dash . Length ) ;
386
+ Debug . Assert ( dash != null ) ;
387
+
388
+ _NativeInstance . StrokeDashArray ( dash , dash . Length ) ;
387
389
}
388
390
389
391
public void StrokeDashOffset ( double value )
0 commit comments