BuildDependencies.Count Property

Returns a value indicating the number of objects in the BuildDependencies collection.

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

Syntax

'Declaration
ReadOnly Property Count As Integer
int Count { get; }
property int Count {
    int get ();
}
abstract Count : int with get
function get Count () : int

Property Value

Type: System.Int32
An integer value representing the number of objects in the BuildDependencies collection.

Examples

public void Example(DTE2 dte)
{

   try
   {
      BuildDependencies bldDepends;
      SolutionBuild slnBuild;

      // Get the BuildDependencies in open solution.
      bldDepends = dte.Solution.SolutionBuild.BuildDependencies;
      // Get the SolutionBuild
      slnBuild = dte.Solution.SolutionBuild;
      // Show the number of Build Dependencies in open solution.
      MessageBox.Show("Number of dependencies: " + bldDepends.Count.ToString());
      // Prove that Build Dependencies parent object is a SolutionBuild object.
      if (bldDepends.Parent.GetType().Equals(slnBuild.GetType()))
         MessageBox.Show("Types match");
      else
         MessageBox.Show("Types do not match");
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}

.NET Framework Security

See Also

Reference

BuildDependencies Interface

EnvDTE Namespace

Other Resources

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