Condividi tramite


Package.CreateTool Method

Enables derived classes to provide an implementation if necessary.

Namespace:  Microsoft.VisualStudio.Shell
Assemblies:   Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)

Syntax

'Dichiarazione
Public Function CreateTool ( _
    ByRef persistenceSlot As Guid _
) As Integer
'Utilizzo
Dim instance As Package
Dim persistenceSlot As Guid
Dim returnValue As Integer

returnValue = instance.CreateTool(persistenceSlot)
public int CreateTool(
    ref Guid persistenceSlot
)
public:
virtual int CreateTool(
    Guid% persistenceSlot
) sealed
abstract CreateTool : 
        persistenceSlot:Guid byref -> int 
override CreateTool : 
        persistenceSlot:Guid byref -> int 
public final function CreateTool(
    persistenceSlot : Guid
) : int

Parameters

  • persistenceSlot
    Type: System.Guid%
    The GUID of the tool window that should be created.

Return Value

Type: System.Int32
S_OK if successful, otherwise an error code.

Implements

IVsPackage.CreateTool(Guid%)

Remarks

Override the CreateTool method in your VSPackage.

The base implementation of the CreateTool method has no effect on the VSPackage. It is provided so that derived classes can provide an implementation if necessary.

The tool windows must be registered with Visual Studio. For information on the relevant registry keys and values, see Registering Tool Windows and ProvideToolWindowAttribute

Tool windows can be configured to be persistent. If a persistent tool window is open when the environment is shut down, it is automatically reopened the next time the environment is launched. To reopen Tool windows automatically when the environment is launched, pass CTW_ForceCreate to CreateToolWindow.

This method should not make the Tool window visible; that is, it should not call Show method.

.NET Framework Security

See Also

Reference

Package Class

Package Members

Microsoft.VisualStudio.Shell Namespace

Package

ProvideToolWindowAttribute