属性或注解(CLR或Java)的酷用途? [英] Cool uses of Attributes or Annotations (CLR or Java)?
本文介绍了属性或注解(CLR或Java)的酷用途?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在CLR的自定义属性什么是一些很酷的应用/ C#code,你已经做了或听说过?另外,标准属性有趣的新用途也行!
What are some cool applications for custom attributes in CLR/C# code that you've done or heard about? Also interesting new uses of the standard attributes is also ok!
编辑:由于Java的注释似乎是一样的CLR的attrbutes,Java注释的使用也是有效的。
Since Java's annotations seems to be the same as CLR's attrbutes, uses of Java annotations is also valid.
推荐答案
- postsharp ,它使用属性注入code(AOP)?
- <$c$c>[TypeDescriptionProvider]$c$c>这可以用来提供自定义的运行特性模型 - 无论是完全不同的特性,或者更快那些一>
- postsharp, which uses attributes to inject code (AOP)?
[TypeDescriptionProvider]
which can be used to provide a custom runtime property model - either completely different properties, or perhaps faster ones- <$c$c>[TypeForwardedTo]$c$c> - 用于移动组件之间类型,而重楼
- <$c$c>[PrincipalPermission]$c$c> - 用于自动执行有关成员的安全
和一些核心那些常常被忽视:
And some core ones that are often overlooked:
这篇关于属性或注解(CLR或Java)的酷用途?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文