Condividi tramite


Proprietà HTMLWindow.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 with get
function get DTE () : DTE

Valore proprietà

Tipo: EnvDTE.DTE
Oggetto DTE.

Note

In Visual Studio l'oggetto DTE è l'oggetto radice del modello di automazione. In altri modelli a oggetti viene spesso chiamato "Applicazione".

Esempi

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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

HTMLWindow Interfaccia

Spazio dei nomi EnvDTE

Altre risorse

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