Exemple #1
0
        public override void Print()
        {
            Console.Write("\n" + GetName());
            Console.WriteLine(", " + GetDescription());
            Console.WriteLine("---------------------");

            IEnumerator iterator = menuComponents.GetEnumerator();

            while (iterator.MoveNext())
            {
                MenuComponent menuComponent = (MenuComponent)iterator.Current;
                menuComponent.Print();
            }
        }
Exemple #2
0
        public override void Print()
        {
            Console.Write("\n" + Name);
            Console.WriteLine(", " + Description);
            Console.WriteLine("---------------------");

            var iterator = _menuComponents.GetEnumerator();

            while (iterator.MoveNext())
            {
                MenuComponent menuComponent = iterator.Current;
                menuComponent?.Print();
            }
        }
        public void PrintVegetarianMenu()
        {
            var iterator = _allMenus.CreateIterator();

            Console.WriteLine("\nVEGETARIAN MENU\n----");
            while (iterator.MoveNext())
            {
                MenuComponent menuComponent = iterator.Current;
                try
                {
                    if (menuComponent.IsVegetarian)
                    {
                        menuComponent.Print();
                    }
                }
                catch (NotImplementedException) { }
            }
        }
Exemple #4
0
        public void PrintVegetarianMenu()
        {
            IEnumerator iterator = allMenus.GetEnumerator();

            Console.WriteLine("\n Vegetarian Menu\n----");
            while (iterator.MoveNext())
            {
                MenuComponent menuComponent = (MenuComponent)iterator.Current;
                try
                {
                    if (menuComponent.IsVegetarian())
                    {
                        menuComponent.Print();
                    }
                }
                catch (InvalidOperationException e)
                { }
            }
        }
Exemple #5
0
 public void PrintMenu()
 {
     allMenus.Print();
 }