void CreatePackageReferenceNode (
			bool installed = true,
			bool installPending = false,
			PackageName updatedPackage = null)
		{
			node = new PackageReferenceNode (null, packageReference, installed, installPending, updatedPackage);
		}
		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);
			}
		}
		ReinstallNuGetPackageAction CreateReinstallPackageAction (
			PackageReferenceNode packageReference,
			IMonoDevelopSolutionManager solutionManager)
		{
			var action = new ReinstallNuGetPackageAction (
				packageReference.Project,
				solutionManager);

			action.PackageId = packageReference.Id;
			action.Version = packageReference.Version;

			return action;
		}
		void Run (string packageId, string packageVersion)
		{
			var packageReference = new PackageReference (
				packageId,
				new SemanticVersion (packageVersion),
				null,
				null,
				false);

			var node = new PackageReferenceNode (packageReference, true);

			reinstaller.Run (node);
		}
		public void Run (PackageReferenceNode packageReferenceNode, ProgressMonitorStatusMessage progressMessage)
		{
			try {
				IPackageManagementProject project = solution.GetActiveProject ();
				ReinstallPackageAction action = project.CreateReinstallPackageAction ();
				action.PackageId = packageReferenceNode.Id;
				action.PackageVersion = packageReferenceNode.Version;

				runner.Run (progressMessage, action);
			} catch (Exception ex) {
				runner.ShowError (progressMessage, ex);
			}
		}
		void Run (string packageId, string packageVersion)
		{
			var packageReference = new PackageReference (
				packageId,
				new SemanticVersion (packageVersion),
				null,
				null,
				false);

			var parentNode = new TestableProjectPackagesFolderNode (project.FakeDotNetProject, null);
			var node = new PackageReferenceNode (parentNode, packageReference, true);

			reinstaller.Run (node);
		}
		IPackageAction CreateUninstallPackageAction (PackageReferenceNode packageReferenceNode)
		{
			var solutionManager = PackageManagementServices.Workspace.GetSolutionManager (packageReferenceNode.Project.ParentSolution);
			if (packageReferenceNode.NeedsRestoreBeforeUninstall ()) {
				return new RestoreAndUninstallNuGetPackageAction (solutionManager, packageReferenceNode.Project) {
					PackageId = packageReferenceNode.Id,
					Version = packageReferenceNode.Version
				};
			}

			return new UninstallNuGetPackageAction (solutionManager, packageReferenceNode.Project) {
				PackageId = packageReferenceNode.Id
			};
		}
		public void Run (PackageReferenceNode packageReferenceNode, ProgressMonitorStatusMessage progressMessage)
		{
			try {
				var solutionManager = PackageManagementServices.Workspace.GetSolutionManager (packageReferenceNode.Project.ParentSolution);

				var action = new ReinstallNuGetPackageAction (
					packageReferenceNode.Project,
					solutionManager);
				action.PackageId = packageReferenceNode.Id;
				action.Version = packageReferenceNode.Version;

				runner.Run (progressMessage, action);
			} catch (Exception ex) {
				runner.ShowError (progressMessage, ex);
			}
		}
		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);
		}
 public PackageReferenceNodeDescriptor(PackageReferenceNode packageReferenceNode)
 {
     this.packageReferenceNode = packageReferenceNode;
 }
		public PackageReferenceNodeDescriptor (PackageReferenceNode packageReferenceNode)
		{
			this.packageReferenceNode = packageReferenceNode;
		}
		public void Run (PackageReferenceNode packageReferenceNode)
		{
			ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRetargetingSinglePackageMessage (packageReferenceNode.Id);
			Run (packageReferenceNode, progressMessage);
		}
		void RemovePackage (PackageReferenceNode packageReferenceNode, ProgressMonitorStatusMessage progressMessage)
		{
			IPackageAction action = CreateUninstallPackageAction (packageReferenceNode);
			PackageManagementServices.BackgroundPackageActionRunner.Run (progressMessage, action);
		}