Share via


Breakpoint.DTE-Eigenschaft

Ruft das Erweiterbarkeitsobjekt der obersten Ebene ab.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

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

Eigenschaftswert

Typ: EnvDTE.DTE
Ein DTE-Objekt.

Hinweise

In Visual Studio ist das DTE-Objekt das Stammobjekt des Automatisierungsmodells, das in anderen Objektmodellen häufig als "Application" bezeichnet wird.

Beispiele

Im folgenden Beispiel wird veranschaulicht, wie die DTE-Eigenschaft verwendet wird.

So testen Sie diese Eigenschaft

  1. Legen Sie einen Haltepunkt in der Zielanwendung fest.

  2. Führen Sie das Add-In aus.

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();

    // dte is a reference to the DTE object passed to you by the
    // OnConnection method that you implement when you create an add-in.
    DTE DTEProp = dte.Debugger.Breakpoints.Item(1).DTE ;
    owp.OutputString("Edition of the environment: " + DTEProp.Edition);
}
' Set a breakpoint in the target application. Run the application in the 
' debug mode.When the program stops at the breakpoint, run the add-in. 
Shared Sub DTEProperty(ByRef dte As EnvDTE.DTE)
    Dim DTEProp As DTE
    DTEProp = dte.Debugger.Breakpoints.Item(1).DTE
    MessageBox.Show("Edition of the environment: " + DTEProp.Edition)
End Sub

.NET Framework-Sicherheit

Siehe auch

Referenz

Breakpoint Schnittstelle

EnvDTE-Namespace

Weitere Ressourcen

Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell