Basically I\'m trying to make a string to function dictionary in c#, I\'ve seen it done like this:
Dictionary>
<
I'd go with the ExpandoObject which was specifically meant to be able to have the CLR support dynamic languages (see IronPython, et al).
static void Main()
{
dynamic expando = new ExpandoObject();
expando.Do = new Func(MyFunc);
expando.Do2 = new Func(MyFunc2);
Console.WriteLine(expando.Do());
Console.WriteLine(expando.Do2("args"));
}
static string MyFunc()
{
return "Do some awesome stuff";
}
static string MyFunc2(string arg)
{
return "Do some awesome stuff with " + arg;
}