【发布时间】:2010-09-30 17:35:18
【问题描述】:
我正在尝试为 LinFu 的接口构建动态代理。代理应该只实现接口定义的属性的 getter 方法,并从字典中返回一个值,其中键是属性名称。
【问题讨论】:
我正在尝试为 LinFu 的接口构建动态代理。代理应该只实现接口定义的属性的 getter 方法,并从字典中返回一个值,其中键是属性名称。
【问题讨论】:
试试:
// 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...
【讨论】: