public void Activate() { bool usingMenu = true; while (usingMenu) { Console.Clear(); menuStructure.ForEach(Console.WriteLine); int.TryParse(Console.ReadLine(), out int r); Console.Clear(); switch (r) { case 0: Console.WriteLine("leaving menu"); usingMenu = false; break; case 1: Bindings.Callid(menuPoints[0]); Console.WriteLine(); Console.WriteLine("press enter to return"); break; case 2: Bindings.Callid(menuPoints[1]); Console.WriteLine(); Console.WriteLine("press enter to return"); break; case 3: Bindings.Callid(menuPoints[2]); Console.WriteLine(); Console.WriteLine("press enter to return"); break; case 4: Bindings.Callid(menuPoints[3]); Console.WriteLine(); Console.WriteLine("press enter to return"); break; case 5: Bindings.Callid(menuPoints[4]); Console.WriteLine(); Console.WriteLine("press enter to return"); break; case 6: Bindings.Callid(menuPoints[5]); Console.WriteLine(); Console.WriteLine("press enter to return"); break; case 7: Bindings.Callid(menuPoints[6]); Console.WriteLine(); Console.WriteLine("press enter to return"); break; case 8: Bindings.Callid(menuPoints[7]); Console.WriteLine(); Console.WriteLine("press enter to return"); break; /*case 9: * Bindings.Callid(menuPoints[8]); * Console.WriteLine(); * Console.WriteLine("press enter to return"); * break;*/ default: Console.WriteLine("input var ikke et menu punkt"); Console.WriteLine(); Console.WriteLine("press enter to return"); break; } Console.ReadLine(); } }
public void Activate() { bool usingMenu = true; while (usingMenu) { Console.Clear(); menuStructure.ForEach(Console.WriteLine); Console.WriteLine(" "); Console.Write(": "); int input = int.Parse(Console.ReadLine()); Console.Clear(); switch (input) { case 0: Console.WriteLine(" :hej hej bye bye "); usingMenu = false; break; case 1: Console.WriteLine(menuDescription[0]); Bindings.Callid(menuPoints[0]); Console.WriteLine(); Console.WriteLine(menuReturn[0]); break; case 2: Console.WriteLine(menuDescription[1]); Bindings.Callid(menuPoints[1]); Console.WriteLine(); Console.WriteLine(menuReturn[1]); break; case 3: Console.WriteLine(menuDescription[2]); Bindings.Callid(menuPoints[2]); Console.WriteLine(); Console.WriteLine(menuReturn[2]); break; case 4: Console.WriteLine(menuDescription[3]); Bindings.Callid(menuPoints[3]); Console.WriteLine(); Console.WriteLine(menuReturn[3]); break; case 5: Console.WriteLine(menuDescription[4]); Bindings.Callid(menuPoints[4]); Console.WriteLine(); Console.WriteLine(menuReturn[4]); break; case 6: Console.WriteLine(menuDescription[5]); Bindings.Callid(menuPoints[5]); Console.WriteLine(); Console.WriteLine(menuReturn[5]); break; case 7: Console.WriteLine(menuDescription[6]); Bindings.Callid(menuPoints[6]); Console.WriteLine(); Console.WriteLine(menuReturn[6]); break; case 8: Console.WriteLine(menuDescription[7]); Bindings.Callid(menuPoints[7]); Console.WriteLine(); Console.WriteLine(menuReturn[7]); break; case 9: Console.WriteLine(menuDescription[8]); Bindings.Callid(menuPoints[8]); Console.WriteLine(); Console.WriteLine(menuReturn[8]); break; default: Console.WriteLine("input var ikke et menu punkt, im sorry."); Console.WriteLine(); Console.WriteLine(menuReturn[9]); break; } Console.ReadLine(); } }