コード例 #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();
        }
コード例 #2
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();
        }
コード例 #3
0
ファイル: Demo.cs プロジェクト: Termininja/TelerikAcademy
        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();
        }