Since .net has a CodeDOM compiler it is very easy to work with and compile code snippets at runtime.
The only real issue is your application architecture must support some kind of plug-in or interface for such a feature.
public class pluginXYZ : IMyAppPlugin
{
public object Run(IMyAPI api, object[] args)
{
}
}
So from the sample above you can see you have created a
IMyAppPlugin
which your snippets must implement and the
IMyAPI
is an interface to your internal functionality say (
Query()
,
LogMessage()
etc.)
There are a lot of commercial and open source syntax highlighting and intellisense editors also which you can use:
Fast Colored TextBox for Syntax Highlighting[
^]
http://www.icsharpcode.net/OpenSource/SD/[
^]