找出CsElement是否为静态字段? (StyleCop自定义规则) [英] Find out if CsElement is a static field? (StyleCop custom rule)
本文介绍了找出CsElement是否为静态字段? (StyleCop自定义规则)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何查询CsElement对象以查看元素是否为静态字段?
How do I query a CsElement object to see if the element is a static field?
我正在为成员字段构建一对m_和s_前缀规则和静态字段。
I'm building a pair of m_ and s_ prefix rules for member fields and static fields.
推荐答案
您绝对应该看看 StyleCop + 。它已经包含您要创建的所有命名规则。
You definitely should take a look at StyleCop+. It already contains all naming rules you're trying to create.
此外,它是开源的。因此,您可以在其中找到许多不同代码分析案例的示例(查找所有静态字段,成员字段等)。
Moreover, it's open-source. So you can find there many examples of different code analysis cases (finding all static fields, member fields, etc.)
这篇关于找出CsElement是否为静态字段? (StyleCop自定义规则)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文