Exemplo n.º 1
0
        public void PrintVegeterianMenu()
        {
            var enumerator = menuComponent.CreateEnumerator();

            while (enumerator.MoveNext())
            {
                var item = enumerator.Current;

                if (item.IsVegeterian == true)
                {
                    item.Print();
                }
            }
        }
Exemplo n.º 2
0
        public void PrintVegetarianMenu()
        {
            var enumerator = _allMenus.CreateEnumerator();

            Console.WriteLine("\nVEGETARIAN MENU\n--------");
            while (enumerator.MoveNext())
            {
                var menuComponent = enumerator.Current;
                try
                {
                    if (menuComponent.IsVegetarian)
                    {
                        menuComponent.Print();
                    }
                }
                catch (NotSupportedException e)
                {
                }
            }
        }