在 Visual Studio 中隐藏区域 [英] Hiding the regions in Visual Studio

查看:57
本文介绍了在 Visual Studio 中隐藏区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 VS 代码折叠问题是个老生常谈的问题,但我在浏览过的所有其他讨论中都找不到这个问题:

I know VS code folding issues are an old chestnut, but I haven't been able to find this in all the other discussions I have browsed through:

我们有一个由 C# 人员组成的团队,有些人喜欢区域,有些人讨厌他们,而且我们似乎没有太多中间立场可以合作.

We have a team of C# guys, some love regions and others hate them and we don't seem to have much middle ground to work with.

是否有用于 VS 的插件或加载项可以隐藏"区域?这样那些需要它们的人会正常地看到它们,但是安装加载项和查看 .cs 文件的人不存在这些区域,就好像它们不存在一样.

Is there a plug- or add-in for VS that will just 'hide' the regions? So that those that want them will see them as normal, but the people that install the add-in and view a .cs file the regions just aren't there, as if they don't exist.

我可以看到在移动代码时这可能是一个问题,它可能会导致某些方法在错误区域内或外的问题,但这可能是团队满意的权衡...

I can see this might be an issue when moving code around that it might cause issues of certain methods being in or outside of the wrong region, but that might be a tradeoff the team is happy with...

推荐答案

我讨厌区域(我的团队喜欢它们)并且惊讶地发现没有人编写扩展来使它们变得更好.我终于自己写了一篇名为我讨厌#Regions:

I hate regions (my team loves them) and was surprised to find that nobody has written an extension to make them better. I finally wrote one myself called I Hate #Regions:

让#regions 少一点(免费):

http://visualstudiogallery.msdn.microsoft.com/0ca60d35-1e02-43b7-bf59-ac7deb9afbca

  • 打开文件时自动扩展区域
  • 可选地防止区域被折叠(但仍然能够折叠其他代码)
  • 为 #region/#end 区域线提供更小、更亮的背景,使其不那么明显(也是一个选项)
  • 在 C# 和 VB 中工作

这篇关于在 Visual Studio 中隐藏区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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