How to keep several files in a tree in Visual Studio?
When you add (for example) WPF window to your project VS creates .xaml and .xaml.cs files. However they are not displayed in a flat list in VS Explorer, rather .xaml.cs is a child file (in terms of the tree) of .xaml file.
How to organize several "custom" files into such tree? For example I have Trainer.cs file and Trainer.Builder.cs file. I would like Builder to be displayed as a child of Trainer.cs file. How to do it?
Please note: I know about folder with files, but I don't want to use it, because in such case even the "main" file is hidden and I have to unfold folder to get it.
Upd开发者_Python百科ate
While searching for difference between VS2008 and VS2010, I found out, that my entire question is a duplicate of SO question -- there you find how to fix a fix for VS2008 to work with VS2010 :-)
Visual Studio 2010 related file nesting
This can be done by editing the registry. A guide to doing this for Visual Studio 2008 can be found here: http://blog.dotnetwise.com/2009/09/visual-studio-2008-custom-nested-files.html
You can also do this through a Visual Studio Extension, but unless this is part of a larger project this is probably overkill. There is a guide to implementing this behavior here: http://pieterderycke.wordpress.com/2011/03/10/adding-support-for-nested-files-in-custom-visual-studio-project-types-with-mpf/
精彩评论