I have a few techniques all with similar parameter types and return values however various names and blocks. I need to pass the name of the technique to run to another strategy that will invoke the passed strategy.
public int Method1(string)
{
// Do something
return myInt;
}
public int Method2(string)
{
// Do something different
return myInt;
}
public bool RunTheMethod([Method Name passed in here] myMethodName)
{
// Do stuff
int i = myMethodName("My String");
// Do more stuff
return true;
}
public bool Test()
{
return RunTheMethod(Method1);
}
This code doesn't work yet this is the thing that I am attempting to do. What I don't understand is the means by which to compose the RunTheMethod code since I need to characterize the parameter.