Propriedade Property.DTE

Obtém o objeto de extensibilidade de nível superior.

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

Sintaxe

'Declaração
ReadOnly Property DTE As DTE
DTE DTE { get; }
property DTE^ DTE {
    DTE^ get ();
}
abstract DTE : DTE
function get DTE () : DTE

Valor de propriedade

Tipo: EnvDTE.DTE
A DTE object.

Comentários

Na Visual Studio, o DTE objeto é a raiz do modelo de automação, os outros modelos de objetos é chamada "Aplicativo".

Exemplos

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

Segurança do .NET Framework

Consulte também

Referência

Property Interface

Namespace EnvDTE

Outros recursos

Como: compilar e executar os exemplos de código de modelo de objeto de automação