Compartilhar via


ModelingPackage.AddToolWindow Method

Adds a tool window to the generated designer for a domain-specific language.

Namespace:  Microsoft.VisualStudio.Modeling.Shell
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Shell.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Shell.10.0.dll)

Syntax

'Declaração
Protected Sub AddToolWindow ( _
    toolWindowType As Type _
)
protected void AddToolWindow(
    Type toolWindowType
)
protected:
void AddToolWindow(
    Type^ toolWindowType
)
member AddToolWindow : 
        toolWindowType:Type -> unit 
protected function AddToolWindow(
    toolWindowType : Type
)

Parameters

  • toolWindowType
    Type: System.Type
    The type of tool window to add.

Remarks

If your package supports tool windows, you should call this method when the ModelingPackage class is initialized.

Only single-instance tool windows are supported. Therefore, a 1:1 mapping always results.

Instances of tool windows are created on demand.

Examples

The following example registers a custom tool window that is defined in the CustomToolWindow class.

protected override void Initialize()
  {
     //Initializes the base class for the package 
     base.Initialize();

     //Registers a custom tool window
     this.AddToolWindow(typeof(CustomToolWindow));
  }

.NET Framework Security

See Also

Reference

ModelingPackage Class

Microsoft.VisualStudio.Modeling.Shell Namespace