Compartir a través de


BuildDependency.DTE Property

Gets the top-level extensibility object.

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

Property Value

Type: EnvDTE.DTE
A DTE object.

Remarks

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

Examples

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

.NET Framework Security

See Also

Reference

BuildDependency Interface

EnvDTE Namespace

Other Resources

How to: Compile and Run the Automation Object Model Code Examples