Esempio n. 1
0
        static void Main(string[] args)
        {
            ComputerShop computerShop = new ComputerShop();
            var          mylappy      = new LaptopBuilder();

            computerShop.ConstructComputer(mylappy);
            mylappy.Computer.DisplayConfiguration();

            var macBook = new AppleBuilder();

            computerShop.ConstructComputer(macBook);
            macBook.Computer.DisplayConfiguration();

            ReadKey();
        }
        private static void Builder()
        {
            ComputerShop    computerShop = new ComputerShop();
            ComputerBuilder computerBuilder;

            computerBuilder = new LaptopBuilder();
            computerShop.ConstructComputer(computerBuilder);
            computerBuilder.Computer.DisplayConfiguration();

            computerBuilder = new DesktopBuilder();
            computerShop.ConstructComputer(computerBuilder);
            computerBuilder.Computer.DisplayConfiguration();

            computerBuilder = new AppleBuilder();
            computerShop.ConstructComputer(computerBuilder);
            computerBuilder.Computer.DisplayConfiguration();
            Console.ReadKey();
        }
Esempio n. 3
0
        private static void Builder()
        {
            ComputerShop computerShop = new ComputerShop();
            ComputerBuilder computerBuilder;

            computerBuilder = new LaptopBuilder();
            computerShop.ConstructComputer(computerBuilder);
            computerBuilder.Computer.DisplayConfiguration();

            computerBuilder = new DesktopBuilder();
            computerShop.ConstructComputer(computerBuilder);
            computerBuilder.Computer.DisplayConfiguration();

            computerBuilder = new AppleBuilder();
            computerShop.ConstructComputer(computerBuilder);
            computerBuilder.Computer.DisplayConfiguration();
            Console.ReadKey();
        }