Grouping autogenerated files to reduce clutter in Solution Explorer

When you create a form, Visual Studio creates two files for you: the Form.cs file and the Form.designer.cs file; they are grouped together.

You can do the same with the files auto-generated by Myxin. Unfortunately, Visual Studio won't let you do that visually, you'll have to edit the .csproj file by hand.
  • Exit Visual Studio
  • Make a backup of your .csproj file
  • Open the .csproj file in an independent text editor (Notepad)
  • Find the line corresponding to the autogenerated file. The line is in the form <Compile Include="MyControl.Mixin.DragAndDrop.cs"> and should be followed by more options for that file, then a </Compile> tag:

    <Compile Include="MyControl.Mixin.DragAndDrop.cs">
      <SubType>Component</SubType>
    </Compile>
  • Between the <Compile> and </EndCompile> tag, add an option in the form <DependentUpon>MyControl.cs</DependentUpon>

    <Compile Include="MyControl.Mixin.DragAndDrop.cs">
      <DependentUpon>MyControl.cs</DependentUpon>
      <SubType>Component</SubType>
    </Compile>
  • Save the file and reopen the solution in Visual Studio
  • The MyControl.Mixin.DragAndDrop.cs file now appears as a child of MyControl.cs:

Clutter001.png

You can of course do that for all your autogenerated mixin files, and also for the .Glue.cs files added to the mixin template.

Last edited Jan 11, 2010 at 10:11 AM by sleclercq, version 4

Comments

No comments yet.