Freigeben über


Property.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 with get
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)
{  
    try
    {   // Open a solution before running this example
        Properties props = dte.Solution.Properties;
        Property prop;
        string msg = "";
        if (props.Count > 0)
        {
            prop = props.Item(1); // Get first property
            msg += "\nThis Property is named: " + prop.Name;
            msg += "\nThis Property is located in a collection within 
            the following solution: " + 
            ((Solution)prop.Collection.Parent).FullName;
            if (prop.Parent.Equals(prop.Collection))
                msg += "\nThe parent and collection properties return 
                the same object.";
            msg += "\nThe DTE property returns: " + prop.DTE.Name;
        }
        MessageBox.Show(msg, "Property Object");
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Property Schnittstelle

EnvDTE-Namespace

Weitere Ressourcen

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