Wednesday, September 28, 2011

Group your files like Visual Studio does its with this VS 2010 Macro...

Alkampfer's Place - Visual Studio macro to group files

"Visual Studio has the concept of grouping files together a feature used mainly from code generation tools to groups generated files under the main file, but this feature can be used even for your class, as shown in Figure1.


Figure 1: Two code files nested inside program.cs

There are a lot of reasons to group files togheter, you can use this technique for group partial classes definition or you can simply want to group logically related files, etc etc. The annoying stuff is that there is no menu in Visual Studio that permits you to obtain this result, but you can solve everything with a macro. Just open the Visual Studio Macro IDE and insert the following macro.



I thought this a cool hack that I don't think I've seen before. I don't know if I'd personally use it (as I don't think I'd organize my code that way, seems it would have issues when shared across a team, etc), but that doesn't mean I can't think it's cool... :)

No comments: