static void Main(string[] args)
        {
            CarConstructor constructor = new CarConstructor();
            Car            car         = constructor.Construct(new Engine(), new Color(), new Transmission());

            constructor.Reconstruction(car);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine("Method Construct..\n");
            Console.ResetColor();

            Car            daewo = new Car();
            CarConstructor CC    = new CarConstructor();

            daewo = CC.Construct("Daewo Lanos", Color.Green, Engine.Disel, Transmission.Mechanical);
            daewo.ShowInfo();

            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine("\nMethod Reconstruct..\n");
            Console.ResetColor();

            daewo = CC.Reconstract(daewo, Engine.Gas);
            daewo.ShowInfo();

            Console.ReadKey();
        }