Sdílet prostřednictvím


Property.DTE – vlastnost

Načtení objektu nejvyšší úrovně rozšiřitelnosti.

Obor názvů:  EnvDTE
Sestavení:  EnvDTE (v EnvDTE.dll)

Syntaxe

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

Hodnota vlastnosti

Typ: EnvDTE.DTE
Objekt DTE.

Poznámky

V Visual Studio, DTE je objekt root automatizace modelu, který ostatní modely objektu často volání "Aplikace".

Příklady

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

Zabezpečení rozhraní .NET Framework

Viz také

Referenční dokumentace

Property Rozhraní

EnvDTE – obor názvů

Další zdroje

Postupy: Kompilace a spuštění příkladů kódu objektu automatizace