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

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

问题描述

在新的Visual Studio 2015中,我得到以下名称可以简化快速操作。在使用String类的静态方法时,我更喜欢使用 String ,而不是 string >



我已经寻找一个选项来自定义这个: TOOLS - >选项 - >文本编辑器 - > C# - >



有没有我可以自定义这个设置吗?或者甚至更好,如果我可以自定义这些设置为所有工作的解决方案/项目?所以每个人都使用相同的编码风格。

解决方案

我刚刚碰到这个问题并同意 String vs string 。我认为你是正确的在工具 - >选项 - >文本编辑器 - > C# - >代码样式,因为我取消了在成员访问表达式中首选内置的预定义类型关键字,这摆脱了我所遇到的名称可以简化消息。



您尝试过这种方法,还是希望对这些定制有更多的控制?


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.

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.

解决方案

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天全站免登陆