如何折叠 c# 中的所有 #regions 和方法?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1569244/
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-08-06 18:57:45  来源:igfitidea点击:

How can I collapse all #regions and methods in c#?

c#ide

提问by Luiscencio

it is very annoying to collapse all one by one...

一一塌陷好烦啊……

采纳答案by Jorge Israel Pe?a

Like Steve said, CTRL+ Mplus CTRL+ Lfor collapsing all regions recursively. This one is a toggle, meaning you can do it again to re-open them.

就像史蒂夫说的,CTRL+ Mplus CTRL+递归L折叠所有区域。这是一个切换,这意味着您可以再次执行以重新打开它们。

Do CTRL+ Mplus CTRL+ Oto collapse all regions non-recursively.

Do CTRL+ Mplus CTRL+O以非递归方式折叠所有区域。

Source: http://weblogs.asp.net/mrdave/archive/2004/09/17/230732.aspx

来源:http: //weblogs.asp.net/mrdave/archive/2004/09/17/230732.aspx

回答by Steve Guidi

CTRL + M, CTRL + L

This will also collapse anything that is collapsible too, such as scopes defined by braces.

这也将折叠任何可折叠的内容,例如大括号定义的范围。

回答by Agent_9191

Quickest way will be to collapse to definitions via Ctrl+M, Ctrl+O. That will collapse all code down to the signature lines.

最快的方法是通过Ctrl+ MCtrl+折叠到定义O。这会将所有代码折叠到签名行。

回答by Mah

right click -> Outlining -> Collapse To Definitions

右键单击 -> 大纲 -> 折叠到定义

回答by Sina Lotfi

  • Collapsing and Openningrecursively: Ctrl+M+L

  • Just Collapsing: Ctrl+M+O

  • Just Openning: Ctrl+M+P

  • Collapsing and Openning递归:Ctrl+ M+L

  • 只是CollapsingCtrl+ M+O

  • 只是OpenningCtrl+ M+P