简体   繁体   English

代表“匿名”接口代理

[英]Delegates to “anonymous” interface proxy

May be you know if the standard .net framework library / ms enterprise library contains something like this functionality: 您可能知道标准的.net Framework库/ ms企业库是否包含类似此功能的内容:

IConvertible proxy = CodegenThatEverybodyNeed.CreateProxy<IConvertible>(
         new Func<TypeCode> {...}, 
         new Func<IFormatProvider,bool>{...} , ...
);

I'm petty sure that this task ("anonymous proxy") is common and it is clear that it is possible to have a run time realization, but do not imagine where I could meet this function... 我很确定这个任务(“匿名代理”)很常见,很显然可以实现运行时,但是不要想象我可以在哪里实现此功能...

PS Of course it is better to have design time realization with type checks, but I have no doubts this is impossible right now. PS当然,使用类型检查实现设计时会更好,但是我毫不怀疑这现在是不可能的。 PPS "Well known" freeware libraries are also welcome. 还欢迎使用PPS“知名”免费软件库。

ObejectBuilder It seems that ObjectBuilder should have this functionality but 15 minutes was not enough to understand how to learn it. ObejectBuilder似乎ObjectBuilder应该具有此功能,但是15分钟不足以了解如何学习它。 http://msdn.microsoft.com/en-us/library/ff647453.aspx http://msdn.microsoft.com/en-us/library/ff647453.aspx

May be somebody have nice sample? 可能有人有好的样品吗?

EntLib Interceptions Also this code should be somewhere int Unit.Interceptions but I do not found how reuse it.. EntLib拦截这段代码也应该放在int Unit.Interceptions的某个地方,但是我没有发现它是如何重用的。

看看Castle动态代理

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM