Instead of
if (somecondition == 1)
{
int result = new myDelegate(MyClass.myMethod1);
}
else
{
int result = new myDelegate(MyClass.myMethod2);
}
Is it possible to do something like this
int result = new myDelegate("MyClass.myMethod" + i.ToString()); }
1 Answer