Leer en inglés

Compartir a través de


ToolBoxTab2.DTE (Propiedad)

Obtiene el objeto de extensibilidad de nivel superior.

Espacio de nombres:  EnvDTE80
Ensamblado:  EnvDTE80 (en EnvDTE80.dll)

Sintaxis

DTE DTE { get; }

Valor de propiedad

Tipo: DTE
Un objeto DTE.

Comentarios

En Visual Studio, el objeto DTE es la raíz del modelo de automatización, al que otros modelos de objetos suelen denominar "Application".

Ejemplos

Este ejemplo muestra la leyenda de la ventana activa, obtenida a través del objeto ToolBoxTab2.DTE. Para obtener más información sobre cómo ejecutar este ejemplo como un complemento, vea Cómo: Compilar y ejecutar los ejemplos de código del modelo de objetos de automatización.

using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void OnConnection(object application, 
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    ToolBoxTabDTEExample (_applicationObject);
}
public void ToolBoxTabDTEExample (DTE2 dte)
{
    ToolBox tlBox;
    ToolBoxTabs tbxTabs;
    ToolBoxTab2 tbxTab;
    try
    {
        // Create an object reference to the IDE's ToolBox object and
        // its tabs.
        tlBox = (ToolBox)_applicationObject.Windows.Item
(Constants.vsWindowKindToolbox).Object;
        tbxTabs = tlBox.ToolBoxTabs;
        // Select the first Toolbox tab.
        tbxTab = (ToolBoxTab2)tbxTabs.Item(1);
        MessageBox.Show("The name of the selected toolbox tab is: " 
+ tbxTab.Name);
        tbxTab.Activate();
        MessageBox.Show("The caption of the active window, 
obtained through the DTE object, is: " + "\n" 
+ tbxTab.DTE.ActiveWindow.Caption);
    }
    catch (Exception ex)
    {
        MessageBox.Show("ERROR: " + ex.Message);
    }
}

Seguridad de .NET Framework

Vea también

Referencia

ToolBoxTab2 Interfaz

EnvDTE80 (Espacio de nombres)