Share via


Proprietà Process.DTE

Ottiene l'oggetto estensibilità di primo livello.

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

Sintassi

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

Valore proprietà

Tipo: EnvDTE.DTE
In DTE oggetto.

Note

in Visual Studio, DTE l'oggetto è la radice del modello di automazione, che altri modelli a oggetti spesso nome “applicazione„.

Esempi

Nell'esempio seguente viene illustrato come utilizzare DTE proprietà.

Per verificare questa 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 sul 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();
    owp.OutputString("\nEdition of the environment: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).DTE.Edition);
    owp.OutputString("\nThe name of the current program: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).Name);
    owp.OutputString("\nThe name of the current program: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).Parent.CurrentProgram.Name);
    owp.OutputString("\nProcess ID: " + 
                        dte.Debugger.DebuggedProcesses.Item(1).ProcessID);
    EnvDTE.Programs programs = 
                        dte.Debugger.DebuggedProcesses.Item(1).Programs;
    owp.OutputString("\nThe name of the current program: " + 
                        programs.Item(1).Name);
}
Shared Sub DTE(ByRef dte As EnvDTE.DTE)
    Dim str As String
    Dim processes As EnvDTE.Processes = dte.Debugger.DebuggedProcesses
    str = "Edition of the environment: " + processes.Item(1).DTE.Edition
    str += vbCrLf + "The name of the current program: " + _
           processes.Item(1).Name
    str += vbCrLf + "The name of the current program: " + _
           processes.Item(1).Parent.CurrentProgram.Name
    str += vbCrLf + "Process ID: " + processes.Item(1).ProcessID.ToString()
    str += vbCrLf + "The name of the current program: " + _
           processes.Item(1).Programs.Item(1).Name
    MessageBox.Show(str, "DTE Property Test")
End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Process Interfaccia

Spazio dei nomi EnvDTE

Altre risorse

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