如何将一个或多个属性应用于项目中的所有类?
如何将属性应用于特定项目中的所有类?! 仅将 CLSCompliant 属性应用于一个类就足够了,还是必须应用于所有类?
感谢您的回答...
How can I apply an attribute to all classes in a particular project?!
And is it enough to apply CLSCompliant attribute to just one class or do I have to apply to all classes?
Thanks for your answers...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

这是属性的声明:
注意 [AttributeUsage]。使用 AttributeTargets.All 表示该属性可以应用于任何内容。其中包括组件:
This is the declaration for the attribute:
Note the [AttributeUsage]. With AttributeTargets.All, it indicates that the attribute can be applied to anything. Which includes the assembly: