次の方法で共有


IVsUIHierarchy Interface

Redirects commands you invoke to the appropriate hierarchy window instead of the standard command handler.

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

Syntax

'宣言
<GuidAttribute("E82609EA-5169-47F4-91D0-6957272CBE9F")> _
<InterfaceTypeAttribute()> _
Public Interface IVsUIHierarchy _
    Implements IVsHierarchy
'使用
Dim instance As IVsUIHierarchy
[GuidAttribute("E82609EA-5169-47F4-91D0-6957272CBE9F")]
[InterfaceTypeAttribute()]
public interface IVsUIHierarchy : IVsHierarchy
[GuidAttribute(L"E82609EA-5169-47F4-91D0-6957272CBE9F")]
[InterfaceTypeAttribute()]
public interface class IVsUIHierarchy : IVsHierarchy
public interface IVsUIHierarchy extends IVsHierarchy

Remarks

When the hierarchy window has focus, any commands that you implement are sent to the hierarchy window instead of to the standard command-handling interface, IOleCommandTarget, which does not support hierarchies. IVsUIHierarchy is similar to IOleCommandTarget in terms of functionality, but also provides information about the item that is currently selected in the hierarchy, based on the value of VSITEMID.

Commands that you want to use from outside of the hierarchy window, such as adding a project item, should not be handled by the IVsUIHierarchy methods. Only use the IVsUIHierarchy interface to handle the following types of commands:

  • Commands that require the UI Hierarchy window to have focus.

  • Commands that act on a specific item within the hierarchy. (If ItemID equals VSITEMID_SELECTION, the command is applied to the selected item or items.)

Handle all other commands related to the active hierarchy with the IOleCommandTarget interface.

Tool tips in a UI hierarchy window are reserved to show the full caption of the node if the caption is being clipped by the current view (i.e. the window is too narrow to show the full caption). You can not provide custom tool tips for UI hierarchy windows.

See illustrations of the implementation and/or calling of this interface in the samples Basic Project, Figures Project, HierUtil7, My C Package, and Solution Extender.

Notes to Implementers:

Implemented by VSPackage writers to handle commands such as Cut, Copy, Paste, Delete, and Rename sent to the hierarchy window.

See Also

Reference

IVsUIHierarchy Members

Microsoft.VisualStudio.Shell.Interop Namespace