Menu

#9 Input parameter validation

open
nobody
General (9)
5
2007-05-30
2007-05-30
Anonymous
No

This took way too long and it's obviously my fault, but some input parameter validation (and according error throwing capability) would be nice. I didn't set the height or width in the NPlot.Web.PlotSurface2D object I was using and kept getting a "Parameter is not valid" error. This error comes from the first line of the Render() method accessing the height and width members to render the bitmap:

System.Drawing.Bitmap b = new System.Drawing.Bitmap( (int)this.Width.Value, (int)this.Height.Value );

Once I set some required properties everything seemed to work pretty well. I like and I'm impressed. Thanks.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.