简体   繁体   English

Visual Studio项目包含多个文件夹

[英]Visual Studio projects with multiple folders

Is there an easy way to use multiple folders in a project with Visual Studio? 有一种简单的方法可以在Visual Studio的项目中使用多个文件夹吗? It has "filters" which look like folders, but it would be really nice to be able to make folders and insert files in them inside VS. 它有“过滤器”,看起来像文件夹,但能够在VS内部制作文件夹并插入文件真的很棒。 Is there an add-in or secret option to enable this behavior? 是否有加载项或机密选项来启用此行为?

With VC++, the folders do not correspond directly with what's on your file system. 使用VC ++时,文件夹与文件系统上的文件不直接对应。 They are simply used to help you organize your project in an independent manner. 它们仅用于帮助您以独立方式组织项目。

The reason they have this design decision is because with C++ you typically have many include and source directories. 他们有这个设计决定的原因是因为使用C ++,你通常有很多包含和源目录。

More on Filters: 更多关于过滤器:

At the top of your "Solution Explorer" window you will see a toolbar button that when hovered over says "Show All Files". 在“解决方案资源管理器”窗口的顶部,您将看到一个工具栏按钮,当悬停在“显示所有文件”上时。 If this button is pressed it does not show you a Folder/Filter structure. 如果按下此按钮,则不会显示文件夹/过滤器结构。 If this button is not pressed it shows you the Folder/Filter structure. 如果未按下此按钮,则会显示文件夹/过滤器结构。

To add a new Folder/Filter, right click on a project of your solution and select Add -> New Filter. 要添加新的文件夹/过滤器,请右键单击解决方案的项目,然后选择添加 - >新过滤器。

Note that for each Folder/Filter that you create you can go into the Folder/Filter properties and set things such as: 请注意,对于您创建的每个文件夹/过滤器,您可以进入“文件夹/过滤器”属性并设置以下内容:

  • Parse files: Whether to parse the files in this folder for auto completion 解析文件:是否解析此文件夹中的文件以进行自动完成
  • SCC Files: Whether the files in this folder should be considered for source control SCC文件:是否应考虑此文件夹中的文件进行源代码管理
  • Filter: Specifies the file types that this folder will hold by default. 过滤器:指定此文件夹默认保留的文件类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM