Поделиться через


IVsPackageDynamicToolOwnerEx Interface

Enables dynamic control of tool window visibility. This interface extends the IVsPackageDynamicToolOwner interface by adding a parameter for the multi-instance ID. This version controls the number of instances that are shown, while the previous version controls only the kind of tool window that is shown, regardless of its instance ID.

This primarily affects tool windows that have the CTW_fForceCreate flag that causes them to be loaded by the shell on startup or when the context is changed.

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

Syntax

'Declaration
<GuidAttribute("91C30F81-E72A-4997-9B07-A0AECB8C9169")> _
<InterfaceTypeAttribute()> _
Public Interface IVsPackageDynamicToolOwnerEx
[GuidAttribute("91C30F81-E72A-4997-9B07-A0AECB8C9169")]
[InterfaceTypeAttribute()]
public interface IVsPackageDynamicToolOwnerEx
[GuidAttribute(L"91C30F81-E72A-4997-9B07-A0AECB8C9169")]
[InterfaceTypeAttribute()]
public interface class IVsPackageDynamicToolOwnerEx
[<GuidAttribute("91C30F81-E72A-4997-9B07-A0AECB8C9169")>]
[<InterfaceTypeAttribute()>]
type IVsPackageDynamicToolOwnerEx =  interface end
public interface IVsPackageDynamicToolOwnerEx

The IVsPackageDynamicToolOwnerEx type exposes the following members.

Methods

  Name Description
Public method QueryShowTool Enables the VSPackage to control whether to show or hide the tool window. The shell calls this method when the user switches views or contexts, for example Design, Debugging, Full Screen.

Top

Remarks

The shell calls the QueryShowTool(Guid%, UInt32, Int32%) method when the user switches window contexts such as debugging or design.

To use this interface, a VSPackage must be registered with a SupportsDynamicToolOwner key. If the registration key SupportsDynamicToolOwner exists on a VSPackage that owns a tool window, the shell loads the package before displaying the tool so that the package can control visibility. Subsequent sessions will not cause the package to be loaded if the tool was not shown again in the previous session, because the window layout is persisted with the window being hidden. Without the SupportsDynamicToolOwner registration, the tool window may be visible initially, since VSPackages are not loaded at startup. To learn more about adding SupportsDynamicToolOwner to a VSPackage registration, see Using a Custom Registration Attribute to Register an Extension.

See Also

Reference

Microsoft.VisualStudio.Shell.Interop Namespace