BuildDependencies::Parent Property
Visual Studio 2015
Gets the immediate parent object of a BuildDependencies collection.
Assembly: EnvDTE (in EnvDTE.dll)
The Parent property returns the immediate parent to the BuildDependencies collection.
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); } }
Show: