Unity Using Interception and Policy Injection

Unity提供了PolicyInjectionBehavior用来为一个类型创建时定义拦截的策略,符合特定条件的类型才会被附加特定的功能,当然之前你必须先定义使用的Interceptor。默认规则有:Assembly、CustomAttribute、Member Name、Method Signature、Namespace、Parameter Type、Property、Return Type、Tag Attribute、Type。当符合特定的MatchingRule后,可以将特定功能的CallHandler拦截附加。

posted @ 2012-08-10 11:43  junchu25  阅读(197)  评论(0编辑  收藏  举报