IVsHierarchyDeleteHandler2 Interface

Deletes one or more items in a solution hierarchy. The interface extends, but does not inherit from, IVsHierarchyDeleteHandler. Needed only if you want your package to use its own deletion prompt.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

[GuidAttribute("78FD1CBD-387B-4262-BD7B-65C34F86356E")]
[InterfaceTypeAttribute()]
public interface IVsHierarchyDeleteHandler2

The IVsHierarchyDeleteHandler2 type exposes the following members.

  NameDescription
Public methodShowMultiSelDeleteOrRemoveMessageDisplays the multiple selection delete or remove message.
Public methodShowSpecificDeleteRemoveMessageShows a specific delete or remove message.
Top

There are two general scenarios: either all of the selected items belong to a single project or they belong to multiple projects.

If all of the selected items belong to one project:

  1. The shell builds the reduced list of items.

  2. The shell calls ShowSpecificDeleteRemoveMessage if the hierarchy supports IVsHierarchyDeleteHandler2.

  3. The project shows its own message, if desired, and returns whether it wants the standard message shown. If the project wants the standard message, it gets shown.

  4. Next, the shell calls the DeleteItem method of the IVsHierarchyDeleteHandler interface.

If the selected items belong to multiple projects:

  1. The shell builds the reduced list of items.

  2. The shell shows the standard message for multiple project selection.

  3. The shell then calls ShowMultiSelDeleteOrRemoveMessage on any hierarchy that supports IVsHierarchyDeleteHandler2. At this point, the operation has already been chosen (whether Delete or Remove) and the projects are simply confirming the action.

  4. If the projects allow the operation to continue (returns false in the pfCancelOperation parameter of the ShowMultiSelDeleteOrRemoveMessage method), the shell calls the DeleteItem method of the IVsHierarchyDeleteHandler as usual.

In either case, the project needs to show the correct message UI by including buttons for delete and remove if it performs deletions or removals.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft