有没有一种办法可以让VS2010扩张或收缩试试我的方法里面块? [英] Is there a way I can make VS2010 expand or contract try blocks inside my methods?
问题描述
我的代码有很多尝试,赶上,finally块。不像方法时,我在VS2010我不能扩大或缩小这些区域隐藏在开发的内容,除了加入的区域。
My code has a lot of try, catch, finally blocks. Unlike methods when I am in VS2010 I can't expand or contract these areas to hide the contents while developing except by adding regions.
try {
vm.R...
vm.Qu..
vm.T...
vm.D...
vm.Fil..
vm.Type..
vm.St..
} catch (Exception e) {
log(e);
return Content(ExceptionExtensions.GetFormattedErrorMessage(e));
}
有程序员使用try块内整理代码或做技术我只是不得不忍受这些代码更大的块。
Is there a technique that programmers use to tidy up code within try blocks or do I just have to live with these larger blocks of code.
推荐答案
如果没有实际修改的代码,我唯一知道的是使用大纲。您可以隐藏它基本上创建了一个轮廓部分,你可以展开和折叠就像一个类,命名空间,方法,#if块的选择等。要做到这一点:
Without actually modifying the code, the only thing I know of is to use outlining. You can "hide" a selection which basically creates an outline section that you can expand and collapse just like a class, namespace, method, #if block, etc. To do this:
- 选择您要折叠的线条。
- 选择Edit\Outlining\Hide选择(或<大骨节病>控制骨节病> + <大骨节病> M 骨节病>,<大骨节病>控制骨节病> + <大骨节病> ^ h 骨节病>与C#键盘方案)
- Select the lines you want to collapse.
- Choose Edit\Outlining\Hide Selection (or Ctrl+M,Ctrl+H with the C# keyboard scheme)
选择现在倒塌,你可以展开和重新折叠它你想就像一个方法的任何时间。 (例如,与左侧或<大骨节病>控制骨节病> + <大骨节病> M 骨节病>,<大骨节病> M 骨节病> +/-字形)
The selection is now collapsed and you can expand it and re-collapse it any time you want just like a method. (e.g. with +/- glyph at the left or with Ctrl+M,M)
这篇关于有没有一种办法可以让VS2010扩张或收缩试试我的方法里面块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!