2009-01-11 69 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...