本文介绍了在Visual Studio或ReSharper中提取局部变量的快捷方式(对于C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS或ReSharper中是否存在用于提取局部变量的快捷方式?我知道有提取字段变量的捷径,但找不到提取局部变量的捷径.预先感谢.

Is there a shortcut for extracting local variable in VS or ReSharper? I know that there are shortcut for extracting field variable but I cannot find for extracting local variable.Thanks in advance.

推荐答案

右键单击局部变量,我得到以下上下文菜单:

Right-clicking a local variable, I get this context menu:

假设您想要突出显示的命令的快捷方式,则可以通过Visual Studio键盘映射器定义自己的快捷方式. (工具->选项->环境->键盘)

Assuming you want shortcuts for the highlighted commands, you can define your own shortcuts through the Visual Studio keyboard mapper. (Tools -> Options -> Environment -> Keyboard)

  • 引入变量... ="ReSharper.ReSharper_IntroVariable"
  • 介绍字段... ="ReSharper.ReSharper_IntroduceField"
  • 介绍参数... ="ReSharper.ReSharper_IntroParameter"

仅供参考,我的键盘快捷方式是由ReSharper通过ReSharper->选项->键盘&菜单并应用"Visual Studio"方案.

FYI My keyboard shortcuts were set by ReSharper via ReSharper -> Options -> Keyboard & Menus and applying the "Visual Studio" scheme.

(使用Visual Studio Community 2015和ReSharper Ultimate 2015.2)

(Using Visual Studio Community 2015 and ReSharper Ultimate 2015.2)

这篇关于在Visual Studio或ReSharper中提取局部变量的快捷方式(对于C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 05:31