Projects.DTE Projects.DTE Projects.DTE Projects.DTE Projects.DTE Property

Definition

Gets the top-level extensibility object.

public:
 property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };
public:
 property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };
[System.Runtime.InteropServices.DispId(200)]
[get: System.Runtime.InteropServices.DispId(200)]
public EnvDTE.DTE DTE { get; }
member this.DTE : EnvDTE.DTE
Public ReadOnly Property DTE As DTE
Property Value

A DTE object.

Examples

public void CodeExample(DTE2 dte)  
{    
    try  
    {   // Open a project before running this sample  
        Projects prjs = dte.Solution.Projects;  
        string msg = "There are " + prjs.Count.ToString() + " projects in this collection.";  
        msg += "
The application containing this Projects collection: " + prjs.DTE.Name; msg += "
The parent object of the Projects collection: " + prjs.Parent.Name; msg += "
The GUID representing the Projects type: " + prjs.Kind; if (prjs.Properties != null) { msg += "
Properties:"; foreach (Property prop in prjs.Properties) { msg += "
" + prop.Name; } } MessageBox.Show(msg, "Projects Collection"); } catch(Exception ex) { MessageBox.Show(ex.Message); } }

Remarks

In Visual Studio, the DTE object is the root of the automation model, which other object models often call "Application".

Applies to