FxCop 自定义规则 - 检查 winform 控件属性

发布于 2024-07-09 23:14:20 字数 100 浏览 5 评论 0原文

我正在寻找 FxCop 规则的示例,该规则检查创建的控件的属性。

有人见过吗? 或者知道如何响应 FxCop SDK 中设置的属性?

富有的。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

下壹個目標 2024-07-16 23:14:20

这绝对不难。 只需过滤从 Control 继承的类型,然后获取字段列表(如果我没记错的话)。

您最好在 http://str8.to/fxcop-forum 询问这个问题 - 他们他们非常活跃,我在那里得到了很大的支持。

祝你好运!

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!

猫烠⑼条掵仅有一顆心 2024-07-16 23:14:20

我的解决方案是迭代为每个被检查的成员提供的指令列表。

如果其类型为 Microsoft.FxCop.SDK.Method,则 _set 前缀标识属性集。

我遇到的唯一问题是,这不允许我识别保留为设计器默认值的属性。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文