1

我正在尝试为 LinFu 的接口构建动态代理。代理应该只实现接口定义的属性的 getter 方法,并从字典中返回一个值,其中键是属性名称。

链接文本

4

1 回答 1

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...
于 2009-01-18T09:59:00.853 回答