如何在 ReSharper 中设置默认前缀?

发布于 2024-12-27 09:29:49 字数 230 浏览 3 评论 0原文

一个非常简单的问题,但我找不到例子: 如何为 ReSharper 中的特定类型设置默认前缀作为命名规则(以便在命名不同时为其添加下划线)?就像所有 TextBox 的“txt”,所有 Label 的“lbl”等等。

我找到了 C# 命名样式规则,但我不知道如何向其中添加特定的类型。有人可以给我举个小例子吗?

A pretty simple question, but I couldn't find an example for it:
How do I set a default prefix, as a naming rule (so that I get it underlined, if it's named differently), for specific types in ReSharper? Like "txt" for all TextBoxs, "lbl" for all Labels and so on.

I found the C# Naming Style rules, but I couldn't figure out, how to add specific types to it. Could someone please give me a little example?

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

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

发布评论

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

评论(1

赠佳期 2025-01-03 09:29:49

我认为当前(在 R# 6.1 中)不可能根据对象的 类型 设置命名规则,我认为这正是您想要的。一般来说,在 .NET 中,微软已经放弃了匈牙利表示法,这就是< code>txtName 等都是示例。

I don't believe it's possible in currently (in R# 6.1) to set naming rules based on an object's type, which is what I think you want. In general, with .NET Microsoft has has turned away from Hungarian Notation, which is what txtName and so on are examples of.

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