Configuration.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

public void CodeExample(DTE2 dte, AddIn addin)
{   // Make sure you have a solution loaded into Visual Studio
    // before running the following example.
    try
    {
        Project prj;
        Configuration config; 
        ConfigurationManager configmgr;
        if (dte.Solution.Projects.Count > 0)
        {
            prj = dte.Solution.Projects.Item(1);
            config = prj.ConfigurationManager.ActiveConfiguration;
            // Returning the Configuration type constant.
            MessageBox.Show(config.Type.ToString());
            // Returns the ConfigurationManager containing the active configuration.
            configmgr = config.Collection;
            // Returns the application containing this active configuration.
            MessageBox.Show(config.DTE.Name);
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Configuration Schnittstelle

EnvDTE-Namespace

Weitere Ressourcen

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