Beispiel #1
0
        private static Landlord CreateLandlordProxy()
        {
            ProxyGenerator proxyGenerator = new ProxyGenerator();
            Landlord       proyLandlord   = proxyGenerator.CreateClassProxy <Landlord>(new IntermediaryIntercetor());

            return(proyLandlord);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("房东委托中介帮其出租房屋!");
            Landlord proxyLandlord = CreateLandlordProxy();

            Console.WriteLine("中介成功出租房屋");
            proxyLandlord.RentHouse();
        }