Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var cp = new CarProxy(new Driver(16));

            cp.Drive();

            Console.ReadLine();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            ICar car = new CarProxy(new Driver()
            {
                Age = 12
            });

            car.Drive();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            ICar car = new CarProxy(new Driver(12)); // 22

            car.Drive();
        }