如何在解决scheme资源pipe理器VS2010中分组部分类文件

可能重复:
在Visual Studio中分组文件

问题是,我想在解决scheme资源pipe理器中以某种方式对部分类文件进行分组,Visual Studio在文件名前面显示一个[+],然后可以展开以查看所有其他依赖项文件。

但是我的class级在下面两行显示。 (见下文)

> CustomerServiceDao.cs > CustomerServiceDao.Query.cs 

我想要的结果就是这样的。

 + CustomerServiceDao.cs > CustomerServiceDao.Query.cs 

是否有任何命名约定,我必须遵循以显示分组文件?

Thx提前

编辑:它的工作。 那很棒。 但是有没有命名约定? 例如,ascx在默认情况下…

如果将.csproj作为文本文件打开(或者从项目的解决scheme资源pipe理器的上下文菜单中select“卸载项目”,然后select“编辑myproject.csproj”),则可以将其更改为在解决scheme资源pipe理器中显示相关文件你想要的风格。

寻找:

 <Compile Include="CustomerServiceDao.cs" /> <Compile Include="CustomerServiceDao.Query.cs" /> 

并编辑它是这样的:

 <Compile Include="CustomerServiceDao.cs" /> <Compile Include="CustomerServiceDao.Query.cs"> <DependentUpon>CustomerServiceDao.cs</DependentUpon> </Compile> 

在Visual Studio编辑器中没有办法直接做到这一点,但是考虑到VS2k10提供的可扩展性模型,在某人产生某些东西之前可能不会太长。

更新: 最新版本的VSCommands声称支持为你做这个:

最新版本支持从IDE分组项目(所以你不必手动破解与DependentUpon项目文件)。

如果你不想放慢拥有大量专有VSCommands扩展的IDE,你可以使用小扩展NestIn 。 它只能分组/取消组合文件

如果您手动编辑.csproj文件,则可以实现此目的。

只需右键单击您的项目,点击Unload Project

从那里,右键单击并点击Edit project.csproj

寻找Compile元素。 像这样添加一个DependentUpon子元素:

 <Compile Include="CustomerServiceDao.cs" /> <Compile Include="CustomerServiceDao.Query.cs"> <DependentUpon>CustomerServiceDao.cs</DependentUpon> </Compile> 

尝试通过安装VScommands1.2来使用组/取消组合项目