public void Resolve()
        {
            // get all project file full paths from solution file
            var projectFiles = LoadProjects(FilePath);

            _resolveur = new RemoveUnusedProjectReferences
            {
                BuilderPath = BuilderPath
            };
            _resolveur.HasBuildErrorsEvent += resolver_HasBuildErrorsEvent;
            _resolveur.ProgressMessageEvent += resolver_ProgressMessageEvent;
            _resolveur.ReferenceCountEvent += _resolveur_ReferenceCountEvent;
            _resolveur.ItemGroupResolvedEvent += _resolveur_ItemGroupResolvedEvent;
            _resolveur.PackageResolveProgressEvent += _resolveur_PackageResolveProgressEvent;
            _resolveur.IsResolvePackage = IsResolvePackage;
            foreach (var projectFile in projectFiles)
            {
                if (_isCancel)
                    break;

                if (!File.Exists(projectFile))
                    continue;

                _resolveur.FilePath = projectFile;
                _resolveur.Resolve();
            }
        }
        void handleCallBack(Func<string> activeFileNameGetter)
        {
            createOutputWindow();
            createProgressDialog();
            createUiShell();

            string builderPath = findMsBuildPath();
            if (string.IsNullOrWhiteSpace(builderPath))
            {
                _helper.ShowMessageBox("MsBuild Exe not found",
                    "MsBuild Executable required to compile project was not found on machine. Aborting...");
                _helper.EndWaitDialog();
                return;
            }

            string filePath = activeFileNameGetter();
            if (string.IsNullOrEmpty(filePath))
            {
                resolveur_ProgressMessageEvent("Invalid file");
                return;
            }

            _resolveur = createResolver(filePath);
            if (_resolveur == null)
                resolveur_ProgressMessageEvent("Unrecognized project or solution type");
            else
            {
                _helper.ResolveurCanceled += helper_ResolveurCanceled;
                _resolveur.IsResolvePackage = packageOption();
                _resolveur.BuilderPath = builderPath;
                _resolveur.FilePath = filePath;
                _resolveur.HasBuildErrorsEvent += resolveur_HasBuildErrorsEvent;
                _resolveur.ProgressMessageEvent += resolveur_ProgressMessageEvent;
                _resolveur.ReferenceCountEvent += resolveur_ReferenceCountEvent;
                _resolveur.ItemGroupResolvedEvent += resolveur_ItemGroupResolvedEvent;
                _resolveur.PackageResolveProgressEvent += _resolveur_PackageResolveProgressEvent;
                _resolveur.Resolve();
            }

            _helper.EndWaitDialog();
        }
Ejemplo n.º 3
0
 public SolutionReferencesResolveUR(IResolveUR resolveUr)
 {
     _resolveur = resolveUr;
 }