Condividi tramite


Filtering the AddItem Dialog Box for Nested Projects

When you display an AddItem dialog box for a nested project, the parent project can control what items are displayed in the dialog box.

The IVsFilterAddProjectItemDlg2 interface lets you filter the nodes that will be in an AddItem dialog box. When the child project displays the AddItem dialog box, the parent can implement the IVsFilterAddProjectItemDlg interface and filter items that would otherwise be displayed in the child's project.

When projects are grouped by function under specific parent projects, you can implement IVsFilterAddProjectItemDlg when the user selects Add Project Item on the shortcut menu in a nested project. Implementing IvsFilterAddProjectItemDlg displays only project items or files specific to that group. Project items for other groups are filtered out of the dialog box, even if they are stored in the same directory.

When a user opens the AddItem dialog box for the child, the parent project's implementation of the IVsFilterAddProjectItemDlg interface is called.

The IVsFilterAddProjectItemDlg interface can also implement filtering by category. For more information, see Adding Items to the Add New Item Dialog Boxes and Registering Project and Item Templates.

See Also

Reference

IVsFilterAddProjectItemDlg2

Concepts

Adding Items to the Add New Item Dialog Boxes

Registering Project and Item Templates

Nesting Projects