本文整理汇总了C#中System.Web.UI.WebControls.Menu.add方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.add方法的具体用法?C# Menu.add怎么用?C# Menu.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.Menu
的用法示例。
在下文中一共展示了Menu.add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
var dinnerMenu = new DinnerMenu();
var breakfastMenu = new BreakfastMenu();
var cafeMenu = new CafeMenu();
MenuComponent breakfastCMenu = new Menu("PANCAKE HOUSE", "Breakfast");
MenuComponent dinnerCMenu = new Menu("FINE DINING ITALIAN", "Dinner");
MenuComponent coffeeCMenu = new Menu("THE TEA HOSE", "Tea Time");
MenuComponent foodCourtMenu = new Menu("THE FOOD COURT - 24 Hours", "All day food");
foodCourtMenu.add(breakfastCMenu);
foodCourtMenu.add(dinnerCMenu);
foodCourtMenu.add(coffeeCMenu);
MenuItem pasta = new MenuItem(5, "Lunch: Pasta", "Pasta", false);
MenuItem soup = new MenuItem(10, "Lunch: Soup", "Soup", true);
MenuItem salad = new MenuItem(15, "Lunch: Salda", "Salda", true);
MenuItem tea = new MenuItem(6, "Tea Time: Tea", "Tea", true);
MenuItem biscuit = new MenuItem(9, "Tea Time: Biscuit", "Biscuit", false);
MenuItem cake = new MenuItem(12, "Tea Time: Cake", "Cake", false);
MenuItem coffee = new MenuItem(11, "Breakfast: Coffee", "Coffee", true);
MenuItem fruit = new MenuItem(22, "Breakfast: Fruit", "Fruit", true);
MenuItem muesly = new MenuItem(33, "Breakfast: Muesly", "Muesly", false);
breakfastCMenu.add(coffee);
breakfastCMenu.add(fruit);
breakfastCMenu.add(muesly);
dinnerCMenu.add(pasta);
dinnerCMenu.add(soup);
dinnerCMenu.add(salad);
coffeeCMenu.add(tea);
coffeeCMenu.add(biscuit);
coffeeCMenu.add(cake);
WaitressComposite superWaittress = new WaitressComposite(foodCourtMenu);
superWaittress.printMenu();
Console.ReadLine();
var javaWaitress = new JavaWaitressIterator(breakfastMenu, dinnerMenu, cafeMenu);
var dinnerOrderId = javaWaitress.AddMenu(dinnerMenu);
var breakfastOrderId = javaWaitress.AddMenu(breakfastMenu);
var cafeOrderId = javaWaitress.AddMenu(cafeMenu);
javaWaitress.PrintOrder(dinnerOrderId);
javaWaitress.PrintOrder(breakfastOrderId);
javaWaitress.PrintOrder(cafeOrderId);
javaWaitress.PrintOrders();
javaWaitress.PrintOrdersWithIterators();
Console.ReadLine();
return;
Console.WriteLine("Testing New Cafe Menu added");
javaWaitress.printCafeMenu_WithEnumerator();
javaWaitress.printCafeMenu_WithIterator();
Console.ReadLine();
return;
Console.WriteLine("\nPrinting BREAKFAST MENU_____________________");
javaWaitress.printBreakfastMenu_WithEnumerator();
Console.WriteLine("\nPrinting LUNCH MENU_____________________");
javaWaitress.printDinnerMenu_WithEnumerator();
Console.WriteLine("\nPrinting ALL menu_____________________");
javaWaitress.printMenu();
Console.WriteLine("\nPrinting vegetarian dishes_____________________");
Console.WriteLine("Item {0} is vegetarian: {1}", "Set A", javaWaitress.isItemVegetarian("Set A"));
Console.WriteLine("Item {0} is vegetarian: {1}", "Set B", javaWaitress.isItemVegetarian("Set B"));
Console.WriteLine("Item {0} is vegetarian: {1}", "Set C", javaWaitress.isItemVegetarian("Set C"));
Console.WriteLine("Item {0} is vegetarian: {1}", "Set D", javaWaitress.isItemVegetarian("Set D"));
Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set A", javaWaitress.isItemVegetarian("Dinner Set A"));
Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set B", javaWaitress.isItemVegetarian("Dinner Set B"));
Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set C", javaWaitress.isItemVegetarian("Dinner Set C"));
Console.WriteLine("Item {0} is vegetarian: {1}", "Dinner Set D", javaWaitress.isItemVegetarian("Dinner Set D"));
Console.ReadLine();
}