Proprietà Languages.DTE

Ottiene l'oggetto estensibilità di primo livello.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

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

Valore proprietà

Tipo: EnvDTE.DTE
Oggetto DTE.

Note

In Visual Studio, DTE è la radice del modello di automazione che, in altri modelli a oggetti, viene spesso chiamato "Applicazione".

Esempi

Nell'esempio riportato di seguito viene illustrato come utilizzare la proprietà DTE.

Per verificare la proprietà:

  1. Impostare un punto di interruzione nell'applicazione di destinazione.

  2. Eseguire l'applicazione di destinazione in modalità di debug.

  3. Quando l'applicazione si interrompe in corrispondenza del punto di interruzione, eseguire il componente aggiuntivo.

public static void DTE(DTE dte)
{
    // Setup debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("DTE Property Test");
    owp.Activate();
    EnvDTE.Languages languages = dte.Debugger.Languages;
    owp.OutputString("\nEdition of the environment: " + languages.DTE.Edition);
    owp.OutputString("\nThird language in the language collection: " + 
                     languages.Item(3).Name);
    owp.OutputString("\nThe name of the current program: " + 
                     languages.Parent.CurrentProgram.Name);
}
Shared Sub DTE(ByRef dte As EnvDTE.DTE)
    Dim languages As EnvDTE.Languages = dte.Debugger.Languages
    Dim str As String = vbCrLf
    str = "Edition of the environment: " + languages.DTE.Edition
    str += vbCrLf + vbCrLf + "Third language in the language collection: "
    str += languages.Item(3).Name
    str += vbCrLf + vbCrLf + "The name of the current program: " + _
           languages.Parent.CurrentProgram.Name
    MessageBox.Show(str, "Language Test - DTE Property")
End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Languages Interfaccia

Spazio dei nomi EnvDTE

Altre risorse

Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione