private static Landlord CreateLandlordProxy() { ProxyGenerator proxyGenerator = new ProxyGenerator(); Landlord proyLandlord = proxyGenerator.CreateClassProxy <Landlord>(new IntermediaryIntercetor()); return(proyLandlord); }
static void Main(string[] args) { Console.WriteLine("房东委托中介帮其出租房屋!"); Landlord proxyLandlord = CreateLandlordProxy(); Console.WriteLine("中介成功出租房屋"); proxyLandlord.RentHouse(); }