我正在寻找免费的 Visual Studio 功能、扩展或宏。这可以帮助解决以下情况。
当我制作原型时,我倾向于将所有类保存在一个文件中(我知道这是不好的做法,但它是一个原型)。然后就到了文件太难导航的地步。因此,我将这些类分解为项目内的单独文件,文件夹结构反映了名称空间。
为了实现这一目标;-
1. 添加新文件夹
2.添加新班级
3. 命名类
4. 将相应部分剪切并粘贴到新的类文件中。
对我来说,第 2 步到第 4 步是新菜单条目的主要素材。
将类剪切为新类文件
剪切为新的部分类文件。
我在 C# 中见过这个功能,但在 VB.net 中没有见过。
那么知道VB.net如何实现这一点吗?
I'm looking for a free Visual Studio feature, extension or macro. that can help with the following situation.
When I prototype I tend to keep all my classes in one file (bad practice I know, but yeah it a prototype). Then comes the point the where the files is too hard to navigate. So I breakout the classes into separate files inside the project, the folder structure reflecting the namespaces.
To achieve the is;-
1. Add new Folder
2. Add new Class
3. Name class
4. Cut and paste corresponding section into new class file.
For me, Steps 2 through 4 are prime fodder for a new Menu entries.
Cut Class as New Class File
Cut as New Partial Class File.
I've seen this feature in C# but not VB.net.
So does know any how to achieve this for VB.net?
发布评论
评论(3)
这是一个在 C# 中执行您想要的操作的宏...查看代码,修改它以使其在 VB 中工作可能相当简单...
http://plisky.net/main/macros/documentation
另外,我很确定所有商业重构工具(Resharper、CodeRush 等)都支持此...
Here's a macro that does what you want in C#... looking at the code it's probably fairly straight forward to modify it to work in VB...
http://plisky.net/main/macros/documentation
Also, I'm pretty sure all the commercial refactoring tools (Resharper, CodeRush, etc.) support this...
Resharper 可以使用 将类型移动到另一个文件或命名空间
Resharper can do this using Move Type to Another File or Namespace
我刚刚偶然发现了这一点,可以向您指出该宏的更新版本,该宏的好意链接。它位于 http://plisky.net/main/plisy.net-visual -工作室生产力宏。
如果您仍然想要它并希望针对 VB 测试它,我可以很高兴地进行更改以支持 VB.net,但由于我不使用 VB,所以我需要一个测试器:) 自从这篇文章发布以来已经有一段时间了,您可能有一些东西不过已经在工作了。
I just stumbled across this and can point you to an updated version of the macro that scrappy kindly linked. Its at http://plisky.net/main/plisy.net-visual-studio-productivity-macros.
If you still want it and wish to test it for VB I can happily make the changes to support VB.net but as I don't use VB I'd need a tester :) As its a while since this post you probably have something working already though.