HTMLWindow.DTE-Eigenschaft

Ruft das Erweiterbarkeitsobjekt der obersten Ebene ab.

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

Syntax

'Declaration
ReadOnly Property DTE As DTE
    Get
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

public void CodeExample(DTE2 dte, AddIn addin)
{
   // Make sure you have an open HTML document before running this example
    try
    {
        if (dte.ActiveDocument.ActiveWindow.Object is HTMLWindow)
        {
            HTMLWindow htmlwin;
            string msg = "";
            htmlwin = dte.ActiveDocument.ActiveWindow.Object as HTMLWindow;
            // Show the related application object's name.
            msg += "The application containing this HTMLWindow is " + htmlwin.DTE.Name;
            // Show the HTMLWindow's parent object.
            msg += "\nThe HTMLWindow's parent object is " + htmlwin.Parent.Type.ToString();
            MessageBox.Show(msg);
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

HTMLWindow Schnittstelle

EnvDTE-Namespace

Weitere Ressourcen

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