Partager via


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)

Syntax

<InterfaceTypeAttribute()> _
<GuidAttribute("78FD1CBD-387B-4262-BD7B-65C34F86356E")> _
Public Interface IVsHierarchyDeleteHandler2

Dim instance As IVsHierarchyDeleteHandler2
[InterfaceTypeAttribute()]
[GuidAttribute("78FD1CBD-387B-4262-BD7B-65C34F86356E")]
public interface IVsHierarchyDeleteHandler2
[InterfaceTypeAttribute()]
[GuidAttribute(L"78FD1CBD-387B-4262-BD7B-65C34F86356E")]
public interface class IVsHierarchyDeleteHandler2
public interface IVsHierarchyDeleteHandler2

Remarks

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.

See Also

Reference

IVsHierarchyDeleteHandler2 Members

Microsoft.VisualStudio.Shell.Interop Namespace