Hello Guys,
I’m working on an Menu for the N18 Display and i have a problem.
I have all the different Menu positions already in a String. And every position has it’s own method, so i need to get the text from the string and convert it to code.
Lets say:
In my perspective this is superior programming (the last thing i programmed was a calculator;) ).
Would it be possible to make an example oriented by my given code?
// call this method with the name of the selected menu position
public void ExecuteMenu(string menuPos)
{
switch (menuPos)
{
case "MenuPos1":
DoMenuPos1();
break;
case "MenuPos2":
DoMenuPos2();
break;
case "MenuPos3":
DoMenuPos3();
break;
}
}
private void DoMenuPos1()
{
// do menu position 1 stuff here...
}
private void DoMenuPos2()
{
// do menu position 2 stuff here...
}
private void DoMenuPos3()
{
// do menu position 3 stuff here...
}
So i looked into it and partly understood it, but if i want to try it in my program I get an error.
The Type or Namespacename “MethodInfo” couldnt be found.