I'm writing a small visualization tool in wpf, the idea is that average users can create interesting visualizations without being programming wizards.
I have a controller class that has methods like StartPath(double x, double y) and LineTo(x,y) CurveTo(...) etc.
The idea is that a user can type these commands into a textbox and have it draw the result on a canvas.
StartPath(0,0);
LineTo(30,50);
LineTo(50,40);
EndPath();
One Idea I had was to use a .cs template that has all the methods implemented, and has an additional Run() command with a replacement token inside. I load the template as a string, insert the user commands into the Run() method, use the new .net 4.0 compilation service to create an assembly on the fly, then load it and invoke its Run() method and access the exposed Path to draw it on a canvas.
Another one would be to actually just parse the textbox, error check it and call the appropriate methods.
Are there any other methods, especially with the new dynamic keyword?