Microsoft.VisualStudio.Project.SolutionListenerForBuildDependencyUpdate.OnAfterOpenProject C# (CSharp) Method

OnAfterOpenProject() public method

Update build dependency list if solution is fully loaded
public OnAfterOpenProject ( IVsHierarchy hierarchy, int added ) : int
hierarchy IVsHierarchy
added int
return int
        public override int OnAfterOpenProject(IVsHierarchy hierarchy, int added)
        {
            // Return from here if we are at load time
            if(added == 0)
            {
                return VSConstants.S_OK;
            }

            IBuildDependencyOnProjectContainer projectNode = hierarchy as IBuildDependencyOnProjectContainer;

            // We will update only nested project types and the BuildNestedProjectsOnBuild flag is set to true
            if(projectNode != null)
            {
                if(projectNode.BuildNestedProjectsOnBuild)
                {
                    // Enum all sub projects and add to dependency list
                    UpdateDependencyListWithSubProjects(projectNode);
                }
            }
            return VSConstants.S_OK;
        }