Compartir a través de


Command.DTE (Propiedad)

Obtiene el objeto de extensibilidad de nivel superior.

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

Sintaxis

'Declaración
ReadOnly Property DTE As DTE
    Get
DTE DTE { get; }
property DTE^ DTE {
    DTE^ get ();
}
abstract DTE : DTE
function get DTE () : DTE

Valor de propiedad

Tipo: EnvDTE.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

public void CodeExample(DTE2 dte, AddIn addin)
{
    try
    {
        // Show number of commands in Commands collection.
        MessageBox.Show(dte.Commands.Count.ToString());
        // Return the Commands collection for the application.
        Commands cmdsColl = dte.Commands;
        // Return a Command object.
        Command cmdObj = cmdsColl.Item("File.NewFile", cmdsColl.Count);
        // Show the full name of Command object's application object.
        MessageBox.Show(cmdObj.DTE.FullName);
        // Display the Command object's name.
        MessageBox.Show(cmdObj.Name);
        // Display whether the Command object's containing collection
        // is the same as the application object's Commands collection.
        string message;
        if (cmdsColl.Equals(cmdObj.Collection))
            message = "Same collection!";
        else
            message = "Different collection!";
        MessageBox.Show(message);
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

Seguridad de .NET Framework

Vea también

Referencia

Command Interfaz

EnvDTE (Espacio de nombres)

Otros recursos

Cómo: Compilar y ejecutar los ejemplos de código del modelo de objetos de automatización