public static void TryUpgrade(List <IVsProject> projects)
        {
            string baseDir = string.Empty;

            if (!string.IsNullOrEmpty(Package.Instance.DTE2.Solution.FullName))
            {
                baseDir = Path.GetDirectoryName(Package.Instance.DTE2.Solution.FullName);
            }
            Dictionary <string, IVsProject> upgradeProjects = new Dictionary <string, IVsProject>();

            foreach (IVsProject project in projects)
            {
                if (DTEUtil.IsCppProject(project) || DTEUtil.IsCSharpProject(project))
                {
                    string fullName = ProjectUtil.GetProjectFullPath(project);
                    if (new OldConfiguration().Load(MSBuildUtils.LoadedProject(fullName, DTEUtil.IsCppProject(project), true), false))
                    {
                        upgradeProjects.Add(FileUtil.RelativePath(baseDir, fullName), project);
                    }
                }
            }

            if (upgradeProjects.Count > 0)
            {
                UpgradeDialog dialog = new UpgradeDialog();
                dialog.StartPosition = FormStartPosition.CenterParent;
                dialog.Projects      = upgradeProjects;
                dialog.ShowDialog();
            }
        }
Пример #2
0
        public static void TryUpgrade(List <EnvDTE.Project> projects)
        {
            String baseDir = String.Empty;

            if (!String.IsNullOrEmpty(Package.Instance.DTE2.Solution.FullName))
            {
                baseDir = Path.GetDirectoryName(Package.Instance.DTE2.Solution.FullName);
            }
            Dictionary <String, EnvDTE.Project> upgradeProjects = new Dictionary <String, EnvDTE.Project>();

            foreach (EnvDTE.Project project in projects)
            {
                if (new OldConfiguration().Load(MSBuildUtils.LoadedProject(project.FullName), false))
                {
                    upgradeProjects.Add(
                        FileUtil.RelativePath(baseDir, project.FullName),
                        project);
                }
            }

            if (upgradeProjects.Count > 0)
            {
                UpgradeDialog dialog = new UpgradeDialog();
                dialog.StartPosition = FormStartPosition.CenterParent;
                dialog.Projects      = upgradeProjects;
                dialog.ShowDialog();
            }
        }
        public static void TryUpgrade(List <IVsProject> projects)
        {
            Dictionary <string, IVsProject> upgradeProjects = new Dictionary <string, IVsProject>();

            foreach (IVsProject project in projects)
            {
                IceBuilderProjectType projectType = IsIceBuilderEnabled(project);
                if (projectType != IceBuilderProjectType.None)
                {
                    upgradeProjects.Add(project.GetDTEProject().UniqueName, project);
                }
            }

            if (upgradeProjects.Count > 0)
            {
                UpgradeDialog dialog = new UpgradeDialog();
                dialog.StartPosition = FormStartPosition.CenterParent;
                dialog.Projects      = upgradeProjects;
                dialog.ShowDialog();
            }
        }
        public static void TryUpgrade(List<EnvDTE.Project> projects)
        {
            String solutionDir = Path.GetDirectoryName(Package.Instance.DTE2.Solution.FullName);
            Dictionary<String, EnvDTE.Project> upgradeProjects = new Dictionary<String, EnvDTE.Project>();
            foreach (EnvDTE.Project project in projects)
            {
                if (new OldConfiguration().Load(MSBuildUtils.LoadedProject(project.FullName), false))
                {
                    upgradeProjects.Add(
                        FileUtil.RelativePath(solutionDir, project.FullName),
                        project);
                }
            }

            if (upgradeProjects.Count > 0)
            {
                UpgradeDialog dialog = new UpgradeDialog();
                dialog.StartPosition = FormStartPosition.CenterParent;
                dialog.Projects = upgradeProjects;
                dialog.ShowDialog();
            }
        }