Пример #1
0
        static void Main(string[] args)
        {
            Movable        bugattiVeyron        = new BugattiVeyron();
            MovableAdapter bugattiVeyronAdapter = new MovableAdapterImpl(bugattiVeyron);

            Console.WriteLine("Car price in USD :" + bugattiVeyron.getPrice());
            Console.WriteLine();
            Console.WriteLine("Car price in Euros :" + bugattiVeyronAdapter.getPrice());
        }
Пример #2
0
        static void Main(string[] args)
        {
            BugattiVeyron      car     = new BugattiVeyron();
            MovableAdapterImpl adapter = new MovableAdapterImpl(car);
            PriceAdapterImpl   adap    = new PriceAdapterImpl(car);

            Console.WriteLine("Before Conversion & implementing adapter");
            Console.WriteLine("Speed in Miles " + car.GetSpeed());
            Console.WriteLine("Price in USD " + car.GetPrice());
            Console.WriteLine("\nAfter Conversion & implementing adapter");
            Console.WriteLine("Speed in KPH " + adapter.GetSpeed());
            Console.WriteLine("Price in EURO " + adap.GetPrice());
        }