Share via


BuildDependency.Collection Property

Returns the BuildDependencies collection containing the BuildDependency object that supports this property.

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

Syntax

'Declaration
ReadOnly Property Collection As BuildDependencies
BuildDependencies Collection { get; }
property BuildDependencies^ Collection {
    BuildDependencies^ get ();
}
abstract Collection : BuildDependencies
function get Collection () : BuildDependencies

Property Value

Type: EnvDTE.BuildDependencies
A BuildDependencies collection.

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