Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating sub items in solution explorer

We use allot of partial classes in C# to categorise our code for large classes. In the solution explorer we will have code files listed as such:

- MyClass.cs
- MyClass.Partial1.cs
- MyClass.Partial2.cs

But what we want to have is something like this (as you would see with designer files etc.):

- MyClass.cs
    ˪ MyClass.Partial1.cs
    ˪ MyClass.Partial2.cs

I'm aware that you can modify the project file manually to set-up this dependency like this:

<Compile Include="MyClass.cs" />
<Compile Include="MyClass.Partial1.cs">
    <DependentUpon>MyClass.cs</DependentUpon>
</Compile>
<Compile Include="MyClass.Partial2.cs">
    <DependentUpon>MyClass.cs</DependentUpon>
</Compile>

Is there a short-cut in visual studio? Or maybe an extension that will help with this? (Without needing to edit the project file manually)

like image 587
Francois Nel Avatar asked Aug 31 '12 10:08

Francois Nel


1 Answers

Duplicate of this and this question.

Their answer: Group Items as available in VSCommands for Visual Studio 2010

There is also a plugin that does only this: NestIn

Update
There is a second plugin that does pretty much the same thing: File Nesting

like image 160
Laoujin Avatar answered Nov 09 '22 01:11

Laoujin