转换" VAR"在Visual Studio中明确的类型? [英] Convert "var" to explicit type in Visual Studio?

查看:168
本文介绍了转换" VAR"在Visual Studio中明确的类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
工具重构C#VAR来显式类型

Visual Studio中是否有任何类型的快捷键(快捷方式意味着短期写出实际的类型名称)的,可以让你写上无功,并把它转化为实际的类型名称?

Does Visual Studio have any type of shortcut (shortcut meaning short of writing out the actual type name) that allows you to write "var" and have it converted to the actual type name?

例如:

var x = new Dictionary<string, string>();



::使用魔法的事情:

::Do magic thing::

Dictionary<string, string> x = new Dictionary<string, string>();



编辑 -
要所有的问题仇敌:我问,因为我是在一个情况在这里我想找到我的解决方案的特定类型的所有引用。瓦尔请不要在搜索中。

EDIT -- To all the question haters: I asked because I was in a situation where I wanted to find all references to a particular type in my solution. Vars don't show up in that search.

推荐答案

第三方工具,如ReSharper的可隐式转换类型的变量来显式类型,反之亦然。 ReSharper的让你大量转换全部或挑选要转换的实例。

Third party tools such as Resharper can convert implicitly typed variables to explicitly typed, and vice versa. Resharper lets you massively convert all of them or pick and choose which instances to convert.

不过,让我直接给你的 C#'变种'VS特定类型的效果,其中赞成和反对隐打字制成。

But let me direct you to C# 'var' vs specific type performance, where the arguments for and against implicitly typing are made.

这篇关于转换&QUOT; VAR&QUOT;在Visual Studio中明确的类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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