2009-01-11 81 views
1

我正在嘗試構建LinFu接口的動態代理。代理應該實現由接口定義的屬性的getter方法,並返回實例中字典中的值,其中鍵是屬性名稱。LinFu動態代理生成

link text

回答

5

嘗試:

// The interceptor class must implement the IInterceptor interface 
var yourInterceptor = new YourInterceptor(); 
var proxyFactory = new ProxyFactory(); 
IYourInterface proxy = proxyFactory.CreateProxy<IYourInterface>(yourInterceptor); 
// Do something useful with the proxy here...