FxCop Custom Rule - Inspecting winform control pro

2019-07-05 02:32发布

I am looking for an example of a FxCop Rule that inspects the properties of controls created.

Has anyone seen one? Or know how to respond to a property set in the FxCop SDK?

Rich.

标签: .net fxcop
2条回答
祖国的老花朵
2楼-- · 2019-07-05 03:11

This is definitely not difficult. Just filter for types that inherit from Control and then get a list of fields (if I remember correctly).

You may be better off asking this at the http://str8.to/fxcop-forum - they are very much active and I've had pretty great support there.

Good luck!

查看更多
时光不老,我们不散
3楼-- · 2019-07-05 03:21

My solutionwas to iterate through the instruction list provided for each member been checked.

If its was of type Microsoft.FxCop.SDK.Method then a prefix of _set identified a property set.

The only issue i have is this doesn't allow me to identify properties that have been left at the designer default values.

查看更多
登录 后发表回答