如何在 ReSharper 中设置默认前缀?
一个非常简单的问题,但我找不到例子: 如何为 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 TextBox
s, "lbl" for all Label
s 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为当前(在 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.