public void Run(ProgressMonitorStatusMessage progressMessage, IPackageAction action, bool clearConsole)
        {
            RunProgressMessage = progressMessage;
            ActionRun          = action;

            RunAction(progressMessage, action);
        }
		public void Run (ProgressMonitorStatusMessage progressMessage, IPackageAction action)
		{
			RunProgressMessage = progressMessage;
			ActionRun = action;

			RunAction (progressMessage, action);
		}
예제 #3
0
        public override void Run()
        {
            var commandLine = PaketCommandLine.CreateCommandLine(GenerateCommandLine());
            ProgressMonitorStatusMessage message = GetProgressMessage(GetPackageIdToDisplay());

            PaketServices.CommandRunner.Run(commandLine, message, NotifyPaketFilesChanged);
        }
        public override void TearDown()
        {
            base.TearDown();

            statusMessage    = null;
            installActionRun = null;
        }
 void UpdatePackage(ProgressMonitorStatusMessage progressMessage, UpdatePackageAction action)
 {
     try {
         PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, action);
     } catch (Exception ex) {
         PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
     }
 }
예제 #6
0
        void RemovePackageReference(ProgressMonitorStatusMessage progressMessage)
        {
            var action = new RemoveNuGetFromProjectPaketAction(
                ReferenceNode.Id,
                ReferenceNode.Project);

            PaketServices.ActionRunner.Run(progressMessage, action);
        }
        void RestorePackages(DotNetProject project)
        {
            ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInProjectMessage();
            var action = new RestoreNuGetPackagesInDotNetCoreProject(project);

            action.ReloadProject = true;
            PackageManagementServices.BackgroundPackageActionRunner.Run(message, action);
        }
예제 #8
0
        void RemoveDependency(ProgressMonitorStatusMessage progressMessage)
        {
            var action = new RemoveNuGetPaketAction(
                DependencyNode.Id,
                DependencyNode.GetPackageDependencyFile());

            PaketServices.ActionRunner.Run(progressMessage, action);
        }
        void RemoveMultiplePackage(PackageDependencyNode[] nodes, ProgressMonitorStatusMessage progressMessage)
        {
            var project = nodes[0].Project;

            string[]       packageIds = nodes.Select(node => node.Name).ToArray();
            IPackageAction action     = PackageReferenceNodeCommandHandler.CreateUninstallPackagesAction(project, packageIds);

            PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, action);
        }
예제 #10
0
 protected override void Run()
 {
     try {
         Update();
     } catch (Exception ex) {
         ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingPackagesInSolutionMessage();
         PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
     }
 }
예제 #11
0
        void Update()
        {
            var updateAllPackages = new UpdateAllNuGetPackagesInSolution(GetSelectedSolution());
            List <IPackageAction> updateActions = updateAllPackages.CreateActions().ToList();

            ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingPackagesInSolutionMessage(updateAllPackages.GetProjects());

            PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, updateActions);
        }
		void Update (UpdateAllPackagesInSolution updateAllPackages, ProgressMonitorStatusMessage progressMessage)
		{
			try {
				List<UpdatePackageAction> updateActions = updateAllPackages.CreateActions ().ToList ();
				PackageManagementServices.BackgroundPackageActionRunner.Run (progressMessage, updateActions);
			} catch (Exception ex) {
				PackageManagementServices.BackgroundPackageActionRunner.ShowError (progressMessage, ex);
			}
		}
 void Update(UpdateAllPackagesInSolution updateAllPackages, ProgressMonitorStatusMessage progressMessage)
 {
     try {
         List <UpdatePackageAction> updateActions = updateAllPackages.CreateActions().ToList();
         PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, updateActions);
     } catch (Exception ex) {
         PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
     }
 }
 public static void Run(DotNetProject project)
 {
     try {
         ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInProjectMessage();
         IPackageAction action = CreateRestorePackagesAction(project);
         PackageManagementServices.BackgroundPackageActionRunner.Run(message, action);
     } catch (Exception ex) {
         ShowStatusBarError(ex);
     }
 }
예제 #15
0
 public static void Run(DotNetProject project, bool restoreTransitiveProjectReferences, bool reevaluateBeforeRestore = false)
 {
     try {
         ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInProjectMessage();
         IPackageAction action = CreateRestorePackagesAction(project, restoreTransitiveProjectReferences, reevaluateBeforeRestore);
         PackageManagementServices.BackgroundPackageActionRunner.Run(message, action);
     } catch (Exception ex) {
         ShowStatusBarError(ex);
     }
 }
        void RemoveMultiplePackages(PackageDependencyNode[] nodes)
        {
            ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRemovingPackagesFromProjectMessage(nodes.Length);

            try {
                RemoveMultiplePackage(nodes, progressMessage);
            } catch (Exception ex) {
                PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
            }
        }
예제 #17
0
 protected override void Run()
 {
     try {
         ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInSolutionMessage();
         var action = new RestoreNuGetPackagesAction(GetSelectedSolution());
         PackageManagementServices.BackgroundPackageActionRunner.Run(message, action);
     } catch (Exception ex) {
         ShowStatusBarError(ex);
     }
 }
예제 #18
0
        public override void DeleteItem()
        {
            ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRemoveNuGetPackageMessage(ReferenceNode.Id);

            try {
                RemovePackageReference(progressMessage);
            } catch (Exception ex) {
                PaketServices.ActionRunner.ShowError(progressMessage, ex);
            }
        }
예제 #19
0
 protected override void Run()
 {
     try {
         ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInProjectMessage();
         IPackageAction action = CreateRestorePackagesAction(GetSelectedDotNetProject());
         PackageManagementServices.BackgroundPackageActionRunner.Run(message, action);
     } catch (Exception ex) {
         ShowStatusBarError(ex);
     }
 }
        public override void DeleteItem()
        {
            var packageReferenceNode = (PackageReferenceNode)CurrentNode.DataItem;
            ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRemoveSinglePackageMessage(packageReferenceNode.Id);

            try {
                RemovePackage(packageReferenceNode, progressMessage);
            } catch (Exception ex) {
                PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
            }
        }
예제 #21
0
 void Update(IPackageManagementProject project)
 {
     try {
         var updateAllPackages = new UpdateAllPackagesInProject(project);
         List <UpdatePackageAction>   updateActions   = updateAllPackages.CreateActions().ToList();
         ProgressMonitorStatusMessage progressMessage = CreateProgressMessage(updateActions, project);
         PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, updateActions);
     } catch (Exception ex) {
         ShowStatusBarError(ex);
     }
 }
 protected override void Run()
 {
     try {
         IPackageManagementProject     project          = PackageManagementServices.Solution.GetActiveProject();
         List <ReinstallPackageAction> reinstallActions = CreateReinstallActions(project).ToList();
         ProgressMonitorStatusMessage  progressMessage  = CreateProgressMessage(reinstallActions);
         PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, reinstallActions);
     } catch (Exception ex) {
         ShowStatusBarError(ex);
     }
 }
 public void ReinstallPackages()
 {
     try {
         var packagesFolderNode = (ProjectPackagesFolderNode)CurrentNode.DataItem;
         List <ReinstallNuGetPackageAction> reinstallActions = CreateReinstallActions(packagesFolderNode).ToList();
         ProgressMonitorStatusMessage       progressMessage  = CreateProgressMessage(reinstallActions);
         PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, reinstallActions);
     } catch (Exception ex) {
         ShowStatusBarError(ex);
     }
 }
 protected override void Run()
 {
     try {
         IPackageManagementProject project            = PackageManagementServices.Solution.GetActiveProject();
         var updateAllPackages                        = new UpdateAllPackagesInProject(project);
         List <UpdatePackageAction>   updateActions   = updateAllPackages.CreateActions().ToList();
         ProgressMonitorStatusMessage progressMessage = CreateProgressMessage(updateActions);
         PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, updateActions);
     } catch (Exception ex) {
         ShowStatusBarError(ex);
     }
 }
예제 #25
0
        protected override void Run()
        {
            ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingPackagesInSolutionMessage();

            try {
                UpdateAllPackagesInSolution updateAllPackages = CreateUpdateAllPackagesInSolution();
                List <UpdatePackageAction>  updateActions     = updateAllPackages.CreateActions().ToList();
                PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, updateActions);
            } catch (Exception ex) {
                PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
            }
        }
		void RemovePackage (PackageReferenceNode packageReferenceNode, ProgressMonitorStatusMessage progressMessage)
		{
			IPackageManagementProject project = PackageManagementServices.Solution.GetActiveProject ();
			UninstallPackageAction action = project.CreateUninstallPackageAction ();
			action.Package = project.FindPackage (packageReferenceNode.Id);

			if (action.Package != null) {
				PackageManagementServices.BackgroundPackageActionRunner.Run (progressMessage, action);
			} else {
				ShowMissingPackageError (progressMessage, packageReferenceNode);
			}
		}
예제 #27
0
        static void RestorePackages(Solution solution, Action <RestoreNuGetPackagesAction> modifyRestoreAction)
        {
            Runtime.AssertMainThread();

            try {
                ProgressMonitorStatusMessage message = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInSolutionMessage();
                var action = new RestoreNuGetPackagesAction(solution);
                modifyRestoreAction(action);
                PackageManagementServices.BackgroundPackageActionRunner.Run(message, action);
            } catch (Exception ex) {
                ShowStatusBarError(ex);
            }
        }
		void CreateRunner ()
		{
			actions = new List<IPackageAction> ();
			progressMessage = new ProgressMonitorStatusMessage ("Status", "Success", "Error", "Warning");
			packageManagementEvents = new PackageManagementEvents ();
			progressMonitorFactory = new FakeProgressMonitorFactory ();
			progressMonitor = progressMonitorFactory.ProgressMonitor;
			instrumentationService = new TestableInstrumentationService ();

			runner = new TestableBackgroundPackageActionRunner (
				progressMonitorFactory,
				packageManagementEvents,
				instrumentationService);
		}
        void CreateRunner()
        {
            actions                 = new List <IPackageAction> ();
            progressMessage         = new ProgressMonitorStatusMessage("Status", "Success", "Error", "Warning");
            packageManagementEvents = new PackageManagementEvents();
            progressMonitorFactory  = new FakeProgressMonitorFactory();
            progressMonitor         = progressMonitorFactory.ProgressMonitor;
            instrumentationService  = new TestableInstrumentationService();

            runner = new TestableBackgroundPackageActionRunner(
                progressMonitorFactory,
                packageManagementEvents,
                instrumentationService);
        }
        public void UpdatePackage()
        {
            var packageReferenceNode = (PackageReferenceNode)CurrentNode.DataItem;
            ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingSinglePackageMessage(packageReferenceNode.Id);

            try {
                IPackageManagementProject project = PackageManagementServices.Solution.GetActiveProject();
                UpdatePackageAction       action  = project.CreateUpdatePackageAction();
                action.PackageId = packageReferenceNode.Id;

                PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, action);
            } catch (Exception ex) {
                PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
            }
        }
 protected override void Run()
 {
     try {
         UpdateAllPackagesInSolution  updateAllPackages = CreateUpdateAllPackagesInSolution();
         ProgressMonitorStatusMessage progressMessage   = ProgressMonitorStatusMessageFactory.CreateUpdatingPackagesInSolutionMessage(updateAllPackages.Projects);
         RestoreBeforeUpdateAction.Restore(updateAllPackages.Projects, () => {
             Runtime.RunInMainThread(() => {
                 Update(updateAllPackages, progressMessage);
             }).Wait();
         });
     } catch (Exception ex) {
         ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateUpdatingPackagesInSolutionMessage();
         PackageManagementServices.BackgroundPackageActionRunner.ShowError(progressMessage, ex);
     }
 }
        void RemovePackage(PackageReferenceNode packageReferenceNode, ProgressMonitorStatusMessage progressMessage)
        {
            IPackageManagementProject project = PackageManagementServices.Solution.GetActiveProject();
            UninstallPackageAction    action  = project.CreateUninstallPackageAction();

            action.Package = project.FindPackage(packageReferenceNode.Id);

            if (action.Package != null)
            {
                PackageManagementServices.BackgroundPackageActionRunner.Run(progressMessage, action);
            }
            else
            {
                ShowMissingPackageError(progressMessage, packageReferenceNode);
            }
        }
예제 #33
0
        protected override void Run()
        {
            IDotNetProject project = GetSelectedProject();

            if (project == null)
            {
                return;
            }

            ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesInProjectMessage();
            var runner = new PackageRestoreRunner();

            PackageManagementBackgroundDispatcher.Dispatch(() => {
                runner.Run(project, progressMessage);
            });
        }
		void CreateRunner ()
		{
			actions = new List<IPackageAction> ();
			progressMessage = new ProgressMonitorStatusMessage ("Status", "Success", "Error", "Warning");
			packageManagementEvents = new PackageManagementEvents ();
			progressMonitorFactory = new FakeProgressMonitorFactory ();
			progressMonitor = progressMonitorFactory.ProgressMonitor;
			repositoryFactoryEvents = new FakePackageRepositoryFactoryEvents ();
			progressProvider = new PackageManagementProgressProvider (repositoryFactoryEvents, handler => {
				handler.Invoke ();
			});

			runner = new TestableBackgroundPackageActionRunner (
				progressMonitorFactory,
				packageManagementEvents,
				progressProvider);
		}
        void CreateRunner()
        {
            actions                 = new List <IPackageAction> ();
            progressMessage         = new ProgressMonitorStatusMessage("Status", "Success", "Error", "Warning");
            packageManagementEvents = new PackageManagementEvents();
            progressMonitorFactory  = new FakeProgressMonitorFactory();
            progressMonitor         = progressMonitorFactory.ProgressMonitor;
            repositoryFactoryEvents = new FakePackageRepositoryFactoryEvents();
            progressProvider        = new PackageManagementProgressProvider(repositoryFactoryEvents, handler => {
                handler.Invoke();
            });

            runner = new TestableBackgroundPackageActionRunner(
                progressMonitorFactory,
                packageManagementEvents,
                progressProvider);
        }
		void RemovePackage (PackageReferenceNode packageReferenceNode, ProgressMonitorStatusMessage progressMessage)
		{
			IPackageAction action = CreateUninstallPackageAction (packageReferenceNode);
			PackageManagementServices.BackgroundPackageActionRunner.Run (progressMessage, action);
		}
		void UpdatePackage (ProgressMonitorStatusMessage progressMessage, UpdatePackageAction action)
		{
			try {
				PackageManagementServices.BackgroundPackageActionRunner.Run (progressMessage, action);
			} catch (Exception ex) {
				PackageManagementServices.BackgroundPackageActionRunner.ShowError (progressMessage, ex);
			}
		}
		public void Run (ProgressMonitorStatusMessage progressMessage, IEnumerable<IPackageAction> actions)
		{
		}
		public Task RunAsync (ProgressMonitorStatusMessage progressMessage, IEnumerable<IPackageAction> actions)
		{
			throw new NotImplementedException ();
		}
		public void ShowError (ProgressMonitorStatusMessage progressMessage, Exception exception)
		{
			ShowErrorProgressMessage = progressMessage;
			ShowErrorException = exception;
		}
		public void ShowError (ProgressMonitorStatusMessage progressMessage, string message)
		{
			ShowErrorProgressMessage = progressMessage;
			ShowErrorMessage = message;
		}
		void ShowMissingPackageError (ProgressMonitorStatusMessage progressMessage, PackageReferenceNode packageReferenceNode)
		{
			string message = GettextCatalog.GetString ("Unable to find package {0} {1} to remove it from the project. Please restore the package first.", packageReferenceNode.Id, packageReferenceNode.Version);
			PackageManagementServices.BackgroundPackageActionRunner.ShowError (progressMessage, message);
		}
		protected override ProgressMonitorStatusMessage CreateCheckingPackageCompatibilityMessage ()
		{
			ProgressStatusMessage = new ProgressMonitorStatusMessage ("Status", "Success", "Error", "Warning");
			return ProgressStatusMessage;
		}