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)
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With