visual-studio CodeRush 交易技巧

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/350383/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 09:59:28  来源:igfitidea点击:

CodeRush Tricks of the Trade

.netvisual-studiocoderush

提问by dr. evil

I was using CodeRushquite while ago and now I'm planning to use it again. I've installed the trial but I forgot all the cool features except Alt+ Home(drop a marker). And when you don't know some cool tricks it's really like burning money (since it's not cheap for personal use).

很久以前我一直在使用CodeRush,现在我打算再次使用它。我已经安装了试用版,但我忘记了除了Alt+ Home(放下标记)之外的所有很酷的功能。当你不知道一些很酷的技巧时,它真的就像烧钱一样(因为它对于个人使用来说并不便宜)。

What do you like about it? What are your best features?

你喜欢它什么?你最好的特点是什么?

My best feature is marker: Alt+ Home(and use escape to go back)

我最好的功能是标记: Alt+ Home(并使用转义返回)

Currently What I like most

目前我最喜欢什么

  • psspace/ pispace, etc. templates to create properties.
  • ccspaceto create constructors.
  • Pressing Tabto navigate between references to identifiers.
  • Shift+ F12to find references in new cool window.
  • Ctrl+ Shift+ .for recent files.
  • Ctrl+ Shift+ Qfor jumping to any function / class.
  • fespace/ pispacefor "for loops".
  • psspace/pispace等模板来创建属性。
  • ccspace创建构造函数。
  • Tab可在对标识符的引用之间导航。
  • Shift+F12在新的酷窗口中查找参考资料。
  • Ctrl+ Shift+.的最新文件。
  • Ctrl+ Shift+Q跳跃到任何函数/类。
  • fespace/pispace用于“for 循环”。

采纳答案by Rob Allen

I recently installed the Xpress version and went on a similar hunt. This cheat-sheetis what I found so far. The XPress version is pretty gimped BTW so I'm trying to get funding for a license.

我最近安装了 Xpress 版本并进行了类似的搜索。这个备忘单是我目前发现的。顺便说一句,XPress 版本非常笨拙,所以我正在努力获得许可资金。

回答by Echostorm

I use these a lot:

我经常使用这些:

  • /will comment or uncomment highlighted blocks of code.

  • bwill wrap a highlighted selection in braces.

  • Ctrl+ 3will wrap a selection into a region.

  • tcwill generate a try/catch block.

  • mbswill write a MessageBox.Show("");and drop the cursor in the quotes.

  • cwswill do the same but with Console.Writeline.

  • mwill create a method block (ms would do a method block that returns type string).

  • .will make a comment block.

  • /将注释或取消注释突出显示的代码块。

  • b将在大括号中包装突出显示的选择。

  • Ctrl+3将选区包装到一个区域中。

  • tc将生成一个 try/catch 块。

  • mbs将写 aMessageBox.Show("");并将光标放在引号中。

  • cws会做同样的事情,但与Console.Writeline.

  • m将创建一个方法块(ms 会创建一个返回类型字符串的方法块)。

  • .将制作一个评论块。

回答by moobaa

NumPad+Pluswidens the scope of your selection one level.

NumPad+Plus将您的选择范围扩大一级。

Try it. It's sublime :)

试试看。这是崇高的:)

回答by Rory Becker

F2- Rename

F2- 改名

Strictly this is a RefactorPro shortcut as the Rename functionality is for RefactorPro. (However since RefactorPro is included in the Price of CodeRush that should not be an issue)

严格来说,这是 RefactorPro 的快捷方式,因为 Rename 功能适用于 RefactorPro。(但是,由于 RefactorPro 包含在 CodeRush 的价格中,这应该不是问题)

It is also, I think, Disabled by default.

我认为它也是默认禁用的。

You should be able to use the DevExpress\Options...\IDE\Shortcutsscreen to search for F2and re-enable it.

您应该能够使用DevExpress\Options...\IDE\Shortcuts屏幕来搜索F2并重新启用它。

Very natural to rename Vars and Methods using F2when you're already used to F2functionality for Files and Folders in Explorer.

F2当您已经习惯F2了资源管理器中文件和文件夹的功能时,使用重命名变量和方法非常自然。

回答by Rory Becker

Search for Type

搜索类型

QuickNav (Ctrl+Shift+Q) can be a bit excessive at times....

QuickNav ( Ctrl+ Shift+ Q) 有时可能有点过分......

If you know you're looking for a Type, bind Ctrl+Tto QuickNavusing additional params of "AllTypes,, AllVisibilities, CurrentSolution" (without quotes)

如果您知道要查找类型,使用“ AllTypes,, AllVisibilities, CurrentSolution”(不带引号)的附加参数将Ctrl+绑定TQuickNav

This will allow you to search for only Types in the current solution

这将允许您仅搜索当前解决方案中的类型

These params can be tweaked to your liking. See http://community.devexpress.com/forums/p/66380/225556.aspx#225556for details

这些参数可以根据您的喜好进行调整。见http://community.devexpress.com/forums/p/66380/225556.aspx#225556详细信息

回答by dr. evil

rt / rf = For Return True and False

rt / rf = 返回真假

回答by Rory Becker

Search for Member

搜索会员

QuickNav (Ctrl+Shift+Q) can be a bit excessive at times....

QuickNav ( Ctrl+Shift+Q) 有时可能有点过分......

If you know you're looking for a Method, bind Ctrl+Mto QuickNavusing additionial params of "AllTypes, AllMembers, AllVisibilities, CurrentFile" (without quotes)

如果您知道要查找方法,使用“ AllTypes、AllMembers、AllVisibilities、CurrentFile”的附加参数(不带引号)将Ctrl+M绑定到QuickNav

This will allow you to search for only Members in the current file.

这将允许您仅搜索当前文件中的成员。

These params can be tweaked to your liking. See http://community.devexpress.com/forums/p/66380/225556.aspx#225556for details

这些参数可以根据您的喜好进行调整。见http://community.devexpress.com/forums/p/66380/225556.aspx#225556详细信息

回答by Rory Becker

Here is a simple CodeRush Template for generating guard clauses.

这是一个用于生成保护子句的简单 CodeRush 模板。

Type inxspacewithin a method, whilst you have a variable reference on the clipboard and you'll get...

键入INXspace的方法中,而你对剪贴板一个变量引用,你会得到...

If [VariableName] Is nothing Then
    return 
End If 

or

或者

if ([VariableName] == null)
{
    return;
}

... depending on the language you're currently operating in.

...取决于您当前使用的语言。

This Template is often referred to within DevExpress Webinarsas If Not Nullor If Null Exit

该模板在DevExpress 网络研讨会中通常被称为If Not NullIf Null Exit

回答by Rory Becker

This is an old post on the DevExpress Coderush Forum:

这是DevExpress Coderush 论坛上的旧帖子

In it is a setting suggestion by Mark Miller to enhance the default "Embed in Parenthesis" feature of CodeRush.

其中是 Mark Miller 的设置建议,用于增强 CodeRush 的默认“嵌入括号”功能。

Once in place ... highlight some text and hit '('. your selection will be wrapped in Parenthesis and more importantly your caret will be on the left of the selection. (Similar applies to the Right Parenthesis)

一旦到位......突出显示一些文本并点击'('。您的选择将被包裹在括号中,更重要的是您的插入符号将在选择的左侧。(类似适用于右括号)

Ideal for VB.Net users to use alongside CInt, CStr etc

非常适合 VB.Net 用户与 CInt、CStr 等一起使用

回答by devXen

Inside VS.NET

VS.NET 内部

Press "Ctrl + Shift + Alt + O" will list all the DX Options (and putting shortcuts in the search box will bring you to the keyboard bindings)

按“Ctrl + Shift + Alt + O”将列出所有 DX 选项(在搜索框中放置快捷方式将带您进入键盘绑定)