属性或注释(CLR 或 Java)的酷用途? [英] Cool uses of Attributes or Annotations (CLR or Java)?

查看:16
本文介绍了属性或注释(CLR 或 Java)的酷用途?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您已经完成或听说过哪些 CLR/C# 代码中自定义属性的酷炫应用程序?标准属性的新用途也很有趣!

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 的属性相同,因此 Java 注释的使用也是有效的.

Since Java's annotations seems to be the same as CLR's attrbutes, uses of Java annotations is also valid.

推荐答案

  • postsharp,使用属性注入代码 (AOP)?
  • [TypeDescriptionProvider] 可用于提供自定义运行时属性模型 - 可以是完全不同的属性,也可以是 更快的
    • 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
    • 还有一些经常被忽视的核心:

      And some core ones that are often overlooked:

      这篇关于属性或注释(CLR 或 Java)的酷用途?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆