Compartir a través de


IVsPackageDynamicToolOwner Interface

Enables a package to show or hide its tool windows dynamically. You can get an instance of the interface from the SIVsPackageDynamicToolOwner (SID_SVsPackageDynamicToolOwner) service.

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

Syntax

'Declaration
<GuidAttribute("7DB81657-7722-4407-B675-9F4A6FEEEA15")> _
<InterfaceTypeAttribute()> _
Public Interface IVsPackageDynamicToolOwner
[GuidAttribute("7DB81657-7722-4407-B675-9F4A6FEEEA15")]
[InterfaceTypeAttribute()]
public interface IVsPackageDynamicToolOwner
[GuidAttribute(L"7DB81657-7722-4407-B675-9F4A6FEEEA15")]
[InterfaceTypeAttribute()]
public interface class IVsPackageDynamicToolOwner
[<GuidAttribute("7DB81657-7722-4407-B675-9F4A6FEEEA15")>]
[<InterfaceTypeAttribute()>]
type IVsPackageDynamicToolOwner =  interface end
public interface IVsPackageDynamicToolOwner

The IVsPackageDynamicToolOwner type exposes the following members.

Methods

  Name Description
Public method QueryShowTool Allows the package to control whether the tool window should be shown or hidden. This method is called by the shell when the user switches to a different window view or context, for example Design, Debugging, Full Screen, etc.

Top

Remarks

Only packages that own tool windows not created with the CTW_fForceCreate flag need to implement this interface. You can also retrieve the interface by querying IVsPackage.

The shell calls the QueryShowTool 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.

The PackageRegistrationAttribute registers the SupportsDynamicToolOwner flag automatically, if the interface is implemented by the VSPackage.

See Also

Reference

Microsoft.VisualStudio.Shell.Interop Namespace