Esempio n. 1
0
        public void Start(Imenu startmenu)
        {
            int h = 0;

            print(h, h, startmenu);
            input(h, startmenu);
        }
Esempio n. 2
0
        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();
            }
        }
Esempio n. 3
0
        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();
            }
        }
Esempio n. 4
0
 public void add(Imenu content)
 {
     menulist.Add(content);
 }
Esempio n. 5
0
 protected AGetFacade(Imenu menu, ICuisine cuisine)
 {
     _menu    = menu;
     _cuisine = cuisine;
 }
Esempio n. 6
0
 public GetFacade(Imenu menu, ICuisine cuisine) : base(menu, cuisine)
 {
 }