示例#1
0
 SolutionContext GetSolutionContext(int i, SolutionContexts solutionContexts) {
     SolutionContext solutionContext = null;
     try {
         solutionContext = solutionContexts.Item(i);
     }
     catch{
     }
     return solutionContext;    
 }
示例#2
0
        SolutionContext GetSolutionContext(int i, SolutionContexts solutionContexts)
        {
            SolutionContext solutionContext = null;

            try {
                solutionContext = solutionContexts.Item(i);
            }
            catch {
            }
            return(solutionContext);
        }
示例#3
0
        // call every build as it could be a different solution
        private uint numProjectsToBeBuilt()
        {
            SolutionContexts solutionContexts = _vspkg.dte.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts;
            uint             num = 0;

            for (int i = 1; i <= solutionContexts.Count; ++i)
            {
                if (solutionContexts.Item(i).ShouldBuild)
                {
                    ++num;
                }
            }
            return(num);
        }
        /// <summary>
        /// Gets the number of projects to be built based on the active solution configuration.
        /// </summary>
        private int getNumberOfProjectsToBeBuilt()
        {
            SolutionContexts solutionContexts = Package.IDE.Solution.SolutionBuild.ActiveConfiguration.SolutionContexts;
            int count = 0;

            for (int i = 0; i < solutionContexts.Count; i++)
            {
                try
                {
                    if (solutionContexts.Item(i + 1).ShouldBuild)
                    {
                        count++;
                    }
                }
                catch (ArgumentException)
                {
                    // This is a work-around for a known issue with the SolutionContexts.GetEnumerator with unloaded projects in VS2010.
                }
            }

            return(count);
        }