public void Start(Imenu startmenu) { int h = 0; print(h, h, startmenu); input(h, startmenu); }
public void input(int pos, Imenu menu) { var k = Console.ReadKey(); int CurPos = pos; Imenu PrevMenu = menu; infinateMenu InfiMatch = new infinateMenu("Match"); while (k.KeyChar != 'q') { if (k.Key == ConsoleKey.UpArrow) { pos--; if (0 <= pos) { print(pos, CurPos, menu); } else { pos = 0; } } if (k.Key == ConsoleKey.DownArrow) { pos++; if (menu.menulist.Count > pos) { print(pos, CurPos, menu); } else { pos = menu.menulist.Count - 1; } } if (k.Key == ConsoleKey.Enter) { PrevMenu = menu; menu = menu.menulist[pos]; if (menu.GetType() == InfiMatch.GetType()) { menu.menulist = new List <Imenu>(); for (int i = 1; i <= 6; i++) { menu.menulist.Add(new infinateMenu(i.ToString())); } } CurPos = pos; pos = 0; print(pos, CurPos, menu); } if (k.Key == ConsoleKey.Backspace) { menu = PrevMenu; print(pos, CurPos, PrevMenu); } k = Console.ReadKey(); } }
public void print(int j, int CurPos, Imenu ItemToDraw) { Console.Clear(); for (int i = 0; i < ItemToDraw.menulist.Count; i++) { if (j == i) { Console.ForegroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.White; } Console.WriteLine(ItemToDraw.menulist[i].Title); Console.ResetColor(); } }
public void add(Imenu content) { menulist.Add(content); }
protected AGetFacade(Imenu menu, ICuisine cuisine) { _menu = menu; _cuisine = cuisine; }
public GetFacade(Imenu menu, ICuisine cuisine) : base(menu, cuisine) { }