Esempio n. 1
0
        internal static void Main()
        {
            VehicleBuilder builder;
            var shop = new Shop();

            builder = new ScooterBuilder();
            shop.Construct(builder);
            builder.Vehicle.Show();

            builder = new CarBuilder();
            shop.Construct(builder);
            builder.Vehicle.Show();

            builder = new MotorCycleBuilder();
            shop.Construct(builder);
            builder.Vehicle.Show();
        }
Esempio n. 2
0
 /// <summary>
 /// Entry point into console application.
 /// </summary>
 public static void Main()
 {
     VehicleBuilder builder;
     // Create shop with vehicle builders
     Shop shop = new Shop();
     // Construct and display vehicles
     builder = new ScooterBuilder();
     shop.Construct(builder);
     builder.Vehicle.Show();
     builder = new CarBuilder();
     shop.Construct(builder);
     builder.Vehicle.Show();
     builder = new MotorCycleBuilder();
     shop.Construct(builder);
     builder.Vehicle.Show();
     // Wait for user
     Console.ReadKey();
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            VehicleBuilder builder;

            Shop shop = new Shop();

            builder = new ScooterBuilder();
            shop.Construct(builder);
            builder.Vehicle.Show();

            builder = new MotorCycleBuilder();
            shop.Construct(builder);
            builder.Vehicle.Show();

            builder = new CarBuilder();
            shop.Construct(builder);
            builder.Vehicle.Show();

            Console.ReadKey();
        }
            /// <summary>
            /// Entry point into console application.
            /// </summary>
            public static void Main()
            {
                VehicleBuilder builder;

                // Create shop with vehicle builders
                Shop shop = new Shop();

                // Construct and display vehicles
                builder = new ScooterBuilder();
                shop.Construct(builder);
                builder.Vehicle.Show();

                builder = new CarBuilder();
                shop.Construct(builder);
                builder.Vehicle.Show();

                builder = new MotorCycleBuilder();
                shop.Construct(builder);
                builder.Vehicle.Show();

                // Wait for user
                Console.ReadKey();
            }
        public static void Main()
        {
            AVehicleBuilder builder;

            Shop shop = new Shop();

            builder = new ScooterBuilder();
            shop.Construct(builder);
            Console.WriteLine("---------------------------");
            Console.WriteLine(builder.Vehicle);

            builder = new CarBuilder();
            shop.Construct(builder);
            Console.WriteLine("\r\n---------------------------");
            Console.WriteLine(builder.Vehicle);

            builder = new MotorCycleBuilder();
            shop.Construct(builder);
            Console.WriteLine("\r\n---------------------------");
            Console.WriteLine(builder.Vehicle);

            Console.ReadKey();
        }