BuildDependencies::Item Method (Object^)
Visual Studio 2015
Gets an indexed member of a BuildDependencies collection.
Assembly: EnvDTE (in EnvDTE.dll)
Parameters
- index
-
Type:
System::Object^
Required. The index of the item to return.
The Item method throws a ArgumentException exception if the collection cannot find the object that corresponds to the index value.
public void Example(DTE2 dte) { try { BuildDependencies bldDepends; BuildDependency bldDependency = null; // Get the BuildDependencies in open solution. bldDepends = dte.Solution.SolutionBuild.BuildDependencies; if (bldDepends.Count > 0) // assign the BuildDependency bldDependency = bldDepends.Item(bldDepends.Count); // Show the BuildDependency returned by the Item property. MessageBox.Show(bldDependency.Project.Name); // Show the BuildDependencies top-level object. MessageBox.Show(bldDepends.DTE.Name); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
Show: