Beispiel #1
0
        static void Main(string[] args)
        {
            CarConstructor factory = new CarConstructor();
            var            car     = factory.Construct(Engine.Diesel, Color.Red, Transmission.Mechanic);

            car.ShowInfo();
            car = factory.Reconstract(car);
            car.ShowInfo();
            Console.ReadLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Engine engine = new Engine {
                EngineModel = "turbo"
            };
            Color color = new Color {
                ColorModel = "grey"
            };
            Transmission transmission = new Transmission {
                TransmissionModel = "mechanics"
            };
            var factory = new CarConstructor();
            var car     = factory.Construct(engine, color, transmission);

            car.ShowInfo();
            factory.Reconstract(car);
            car.ShowInfo();
            color.ColorModel = "";
            car.ShowInfo();
            Console.ReadLine();
        }