在 Visual Studio 中隐藏区域

编程入门 行业动态 更新时间:2024-10-25 12:25:47
本文介绍了在 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 少一点(免费):

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

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

更多推荐

在 Visual Studio 中隐藏区域

本文发布于:2023-11-16 19:55:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1607243.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:区域   Visual   Studio

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!