BuildDependency.DTE Property

 

Gets the top-level extensibility object.

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

DTE DTE { get; }

Property Value

Type: EnvDTE.DTE

A DTE object.

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

public void Example(DTE2 dte, AddIn addin)
{
   try
   {
      // Make sure there is at least one BuildDependency in your
      // solution to run this code.
      BuildDependencies bldDepends;
      BuildDependency bldDependency = null;

      bldDepends = dte.Solution.SolutionBuild.BuildDependencies;
      if (bldDepends.Count > 0)
         bldDependency = bldDepends.Item(bldDepends.Count);

      // 
      if (bldDependency.Collection.Count > 0)
         MessageBox.Show(bldDependency.DTE.Name);
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}
Return to top
Show: