[英]How to change resharpers default access modifier to public instead of internal for generated classes?
when you auto generate a class, by default resharper seems to go with internal class Blah
, but I'd like it to default to public class Blah
当你自动生成一个类时,默认情况下resharper似乎与internal class Blah
一起使用,但是我希望它默认为public class Blah
I can understand why, because at that moment of generation, it is only internally scoped, but very quickly I will use it publicly scoped. 我可以理解为什么,因为在生成的那一刻,它只是内部范围,但很快我会公开使用它。 Which requires an auto fixup, which is just annoying. 这需要一个自动修复,这只是烦人的。 I'd like to be able specify the default access modifier 我希望能够指定默认访问修饰符
I have 2017.1.2 我有2017.1.2
The way I generate the class is as following :- 我生成课程的方式如下: -
var x = new Blah()
ALT + ENTER -> Create Type /Generate Class var x = new Blah()
ALT + ENTER - > Create Type / Generate Class
You have to modify the templates. 您必须修改模板。 Resharper => Tools => Template Explorer choose Live/File Templates for the c#. Resharper =>工具=>模板资源管理器为c#选择实时/文件模板。 Now you can edit to whatever you like. 现在您可以编辑任何您喜欢的内容。
Templates Explorer Window 模板浏览器窗口
edit : 编辑 :
Seems that you are invoking through "quick fixes" suggestions. 似乎您正在调用“快速修复”建议。 Probably related to the "search/replace patterns". 可能与“搜索/替换模式”有关。 Didnt see the default exposed though. 虽然没有看到默认曝光。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.