Resharper:如何强制在类的底部引入新的私有字段? [英] Resharper: how to force introducing new private fields at the bottom of the class?

查看:110
本文介绍了Resharper:如何强制在类的底部引入新的私有字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您在构造函数中指定新参数时,Resharper会提供非常有用的 介绍和初始化字段xxx 操作:

Resharper offers a very useful introduce and initialize field xxx action when you specify a new parameter in a constructor like:

Constructor (int parameter)

小的)妨害是它把新的领域放在类的开始 - 我是一个粉丝,把私人部分尽可能远离陌生人的窥视。

The only (minor) nuisance is that it puts the new field at the beginning of the class - and I'm a fan of putting private parts as far away as possible from the prying eyes of strangers ;).

但是,如果你已经在类中有一些私有字段,Resharper会把新字段正确(注意引号,我不想开始

If, however, you already have some private fields in the class, Resharper will put the new field "correctly" (note the quotes, I don't want to start a flame war over this issue) next to those, even if they are at the end of the class.

有一种方法强制Resharper 总是

Is there a way to force Resharper to always put new fields at the end of the class?

更新:好的,我忘了提及我知道类型成员布局在选项功能,

UPDATE: OK, I forgot to mention I know about the "Type Members Layout in Options" feature, but some concrete help on how to modify the template to achieve fields placement would be nice.

推荐答案

如果你还没有,你可以应在ReSharper Jira网站上提交错误报告:

If you haven't already, you should lodge a bug report at the ReSharper Jira site:

http://www.jetbrains.net/jira/browse/RSRP

请先查看是否有人已报告此问题。如果是,您可以对他们的问题进行投票,并通知他们有任何更改。

Have a look first to see if someone has already reported this. If so, you can vote on their issue and be notified of any changes to it.

这篇关于Resharper:如何强制在类的底部引入新的私有字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆