Visual Studio 2015 - 代码样式设置 [英] Visual Studio 2015 - Code style settings

查看:23
本文介绍了Visual Studio 2015 - 代码样式设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在新的 Visual Studio 2015 中,我得到以下名称可以简化"的快速操作.在使用 String 类的静态方法时,我更喜欢使用 String 而不是 string 因为提供了更好的概览.

In the new Visual Studio 2015 I get the following "Name can be simplified" quick action. I prefer using String over string when using the static methods of the String class because gives a better overview.

我在以下位置寻找了一个自定义选项:TOOLS ->选项 ->文本编辑器 ->C# ->代码风格,但没有太多.

I have looked for an option to customize this under: TOOLS -> Options -> Text Editor -> C# -> Code Style, but there was not much there.

无论如何我可以自定义此设置吗?或者,如果我可以为从事解决方案/项目的每个人自定义这些设置,那就更好了?所以每个人都使用相同的编码风格.

Is there anyway I can customize this settings? Or even better if I can customize these settings for everyone working on the solution/project? So everyone uses the same coding style.

推荐答案

我自己刚刚遇到这个问题,并同意 Stringstring 的静态方法.我认为您在查看 TOOLS -> 时是正确的选项 ->文本编辑器 ->C# ->代码样式,因为我取消了在成员访问表达式中首选内部预定义类型关键字",这摆脱了我遇到的名称可以简化"消息.

I just came across this myself and agree on String vs string for static methods. I think you were correct in looking in TOOLS -> Options -> Text Editor -> C# -> Code Style, because I unticked "Prefer intrinsic predefined type keyword in member access expressions" and this got rid of the "Name can be simplified" message that I was experiencing.

您是否尝试过这个,或者您希望对自定义有更多的控制?

Did you try this or are you looking to have more control over the customisations?

这篇关于Visual Studio 2015 - 代码样式设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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