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(); } }
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) { } } }
public void PrintMenu() { AllMenus.Print(); }