Пример #1
0
        static void Main(string[] args)
        {
            var cp = new CarProxy(new Driver(16));

            cp.Drive();

            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            ICar car = new CarProxy(new Driver()
            {
                Age = 12
            });

            car.Drive();
        }
Пример #3
0
        static void Main(string[] args)
        {
            var driver = new Driver {
                Name = "Joe", Age = 12
            };
            ICar car = new CarProxy(driver, new Car());

            car.Drive();
            driver.Age = 18;
            car.Drive();
        }
Пример #4
0
        static void Main(string[] args)
        {
            var car = new CarProxy(new Driver {
                Age = 12
            });

            car.Drive();

            var car2 = new CarProxy(new Driver {
                Age = 16
            });

            car2.Drive();
        }
Пример #5
0
        static void Main(string[] args)
        {
            ICar car = new CarProxy(new Driver(12)); // 22

            car.Drive();
        }