static void Main(string[] args) { var cp = new CarProxy(new Driver(16)); cp.Drive(); Console.ReadLine(); }
static void Main(string[] args) { ICar car = new CarProxy(new Driver() { Age = 12 }); car.Drive(); }
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(); }
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(); }
static void Main(string[] args) { ICar car = new CarProxy(new Driver(12)); // 22 car.Drive(); }