Пример #1
0
        public static void Main(string[] args)
        {
            PopulateCatalogs();

            Recipe recipe = new Recipe();

            recipe.FinalProduct = GetProduct("Café con leche");
            recipe.AddStep(new Step(GetProduct("Café"), 100, GetEquipment("Cafetera"), 120));
            recipe.AddStep(new Step(GetProduct("Leche"), 200, GetEquipment("Hervidor"), 60));

            IPrinter printer = new PrintFile();

            printer = new PrintConsole();
            printer.PrintRecipe(recipe);
            printer = new PrintFile();
            printer.PrintRecipe(recipe);
        }
Пример #2
0
        public static void Main(string[] args)
        {
            PopulateCatalogs();

            Recipe recipe = new Recipe();

            recipe.FinalProduct = GetProduct("Café con leche");
            recipe.AddStep(new Step(GetProduct("Café"), 100, GetEquipment("Cafetera"), 120));
            recipe.AddStep(new Step(GetProduct("Leche"), 200, GetEquipment("Hervidor"), 60));

// Modifico creo una instancia de IPrinter y la llamo para que imprima en consola y en archivo con los metodos de las respectivas clases
            IPrinter printer = new PrintFile();

            printer = new PrintFile();
            printer.PrintRecipe(recipe);
            printer = new PrintConsole();
            printer.PrintRecipe(recipe);
        }