static void Main()
        {
            Creator creator  = new Creator();
            Product product1 = creator.FactoryMethod(Yakitlar.Benzin);
            Product product2 = creator.FactoryMethod(Yakitlar.Dizel);
            Product product3 = creator.FactoryMethod(Yakitlar.LPG);

            product1.Sec();
            product2.Sec();
            product3.Sec();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Creator creator = new Creator();
            IShape  shape;

            shape = creator.FactoryMethod("Square", 2, 10);

            Console.WriteLine("{0} area: {1}", (shape as Square).Name, shape.GetArea());

            shape = creator.FactoryMethod("Circle", 2, 10);

            Console.WriteLine("\n{0} area: {1}", (shape as Circle).Name, shape.GetArea());

            Console.ReadKey();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Creator c = new Creator();
            Product product;

            for (int month = 1; month < 12; month++)
            {
                product = c.FactoryMethod(month);
                Console.WriteLine("Coffee Beans: " + product.ShipFrom());
            }
            Console.ReadKey();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            Creator  c = new Creator();
            IProduct product;

            for (int i = 1; i <= 12; i++)
            {
                product = c.FactoryMethod(i);
                Console.WriteLine($"Avocados {product.ShipFrom()}");
            }

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            #region Lab_1
            Creator c = new Creator();

            IProduct product;

            for (int month = 1; month <= 12; month++)
            {
                product = c.FactoryMethod(month);
                Console.WriteLine("Coffee Beans " + product.ShipFrom());
            }
            #endregion


            #region Lab_2
            SystemManager systemManager = new SystemManager(new SystemLoggerFactory());
            systemManager.Save();

            #endregion
            Console.ReadKey();
        }