Find out if CsElement is a static field? (StyleCop custom rule)

a 夏天 提交于 2019-12-24 07:05:22

问题


How do I query a CsElement object to see if the element is a static field?

I'm building a pair of m_ and s_ prefix rules for member fields and static fields.


回答1:


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.)



来源:https://stackoverflow.com/questions/6037695/find-out-if-cselement-is-a-static-field-stylecop-custom-rule

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!