Exemplo n.º 1
0
        public override void Print()
        {
            Console.Write($"\n{Name}, {Description}\n --------------");
            IEnumerator <MenuComponent> Iterator = MenuComponents.GetEnumerator();

            while (Iterator.MoveNext())
            {
                MenuComponent component = (MenuComponent)Iterator.Current;
                component.Print();
            }
        }
Exemplo n.º 2
0
        public void PrintVegetarianMenu()
        {
            IEnumerator <MenuComponent> enumerator = AllMenus.CreateIterator();

            Console.WriteLine("\nVEGETARIAN MENU-----");
            while (enumerator.MoveNext())
            {
                MenuComponent menuComponent = (MenuComponent)enumerator.Current;
                try
                {
                    if (menuComponent.IsVegetarian)
                    {
                        menuComponent.Print();
                    }
                }
                catch (InvalidOperationException ex) { }
            }
        }
Exemplo n.º 3
0
 public void PrintMenu()
 {
     AllMenus.Print();
 }