Share via


IVsHierarchyDeleteHandler2 Interface

Definition

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.

public interface class IVsHierarchyDeleteHandler2
public interface class IVsHierarchyDeleteHandler2
__interface IVsHierarchyDeleteHandler2
[System.Runtime.InteropServices.Guid("78FD1CBD-387B-4262-BD7B-65C34F86356E")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsHierarchyDeleteHandler2
[<System.Runtime.InteropServices.Guid("78FD1CBD-387B-4262-BD7B-65C34F86356E")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsHierarchyDeleteHandler2 = interface
Public Interface IVsHierarchyDeleteHandler2
Attributes

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.

Methods

ShowMultiSelDeleteOrRemoveMessage(UInt32, UInt32, UInt32[], Int32)

Displays the multiple selection delete or remove message.

ShowSpecificDeleteRemoveMessage(UInt32, UInt32, UInt32[], Int32, UInt32)

Shows a specific delete or remove message.

Applies to