Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            SandwichMenu menu = new SandwichMenu();

            menu["BLT"]  = new Sandwich("Wheat", "Bacon", "Lettuce", "Tomato");
            menu["PB&J"] = new Sandwich("White", "Beef", "Iceberg", "Tomato");

            Sandwich sandwich1 = menu["BLT"].Clone() as Sandwich;
            Sandwich sandwich2 = menu["PB&J"].Clone() as Sandwich;
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            SandwichMenu sandwichMenu = new SandwichMenu();

            sandwichMenu["BLT"]    = new Sandwich("Wheat", "Bacon", "", "Lettuce, Tomato");
            sandwichMenu["PB&J"]   = new Sandwich("White", "", "", "Penaut Butter, Jelly");
            sandwichMenu["Turkey"] = new Sandwich("Rye", "Turkey", "Swiss", "Lettuce, Onion, Tomato");


            Sandwich sandwich1 = sandwichMenu["BLT"].Clone() as Sandwich;
        }