private void btnInstall_Click(object sender, EventArgs e) { var package = lstAvailableMods.SelectedItem as IPackage; var existingPackages = _ProjectManager.LocalRepository.FindPackagesById(package.Id); if (existingPackages.Any()) { _ProjectManager.RemovePackageReference(package, true, false); } _ProjectManager.AddPackageReference(package, false, true); RefreshModLists(); }
private static void RollbackProjectActions(IProjectManager projectManager, IEnumerable <IPackage> packagesAdded, IEnumerable <IPackage> packagesRemoved) { // Disable logging when rolling back project operations projectManager.Logger = null; foreach (var package in packagesAdded) { // Remove each package that was added projectManager.RemovePackageReference(package, forceRemove: false, removeDependencies: false); } foreach (var package in packagesRemoved) { // Add each package that was removed projectManager.AddPackageReference(package, ignoreDependencies: true, allowPrereleaseVersions: true); } }
public void InstallPackage(string packageId, string version) { string folderName = string.Format("{0}.{1}", packageId, version); string fullPath = Path.Combine(_localRepositoryPath, folderName, _flagFileName); //Create flag file to prevent multiple installations of the same package _projectManager.PackageReferenceAdded += (sender, args) => { if (!File.Exists(fullPath)) { File.Create(fullPath); } }; _projectManager.AddPackageReference(packageId, new SemanticVersion(version), true, false); _projectSystem.Save(); }
private void AddPackageReference(IProjectManager projectManager, IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions) { RunProjectAction(projectManager, () => projectManager.AddPackageReference(package, ignoreDependencies, allowPrereleaseVersions)); }
private void AddPackageReference(IProjectManager projectManager, string packageId, SemanticVersion version, bool ignoreDependencies, bool allowPrereleaseVersions) { RunProjectAction(projectManager, () => projectManager.AddPackageReference(packageId, version, ignoreDependencies, allowPrereleaseVersions)); }
public void InstallPackage(String id, SemanticVersion version) { _projectManager.AddPackageReference(id, version, false, true); }
private static void RollbackProjectActions(IProjectManager projectManager, IEnumerable<IPackage> packagesAdded, IEnumerable<IPackage> packagesRemoved) { // Disable logging when rolling back project operations projectManager.Logger = null; foreach (var package in packagesAdded) { // Remove each package that was added projectManager.RemovePackageReference(package, forceRemove: false, removeDependencies: false); } foreach (var package in packagesRemoved) { // Add each package that was removed projectManager.AddPackageReference(package, ignoreDependencies: true, allowPrereleaseVersions: true); } }
private void AddPackageReference(IProjectManager projectManager, IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions) { RunProjectAction(projectManager, () => projectManager.AddPackageReference(package, ignoreDependencies, allowPrereleaseVersions)); }
private void AddPackageReference(IProjectManager projectManager, string packageId, SemanticVersion version, bool ignoreDependencies, bool allowPrereleaseVersions) { RunProjectAction(projectManager, () => projectManager.AddPackageReference(packageId, version, ignoreDependencies, allowPrereleaseVersions)); }
private void AddPackageReference(IProjectManager projectManager, string packageId, Version version, bool ignoreDependencies) { RunProjectAction(projectManager, () => projectManager.AddPackageReference(packageId, version, ignoreDependencies)); }
private void AddPackageReference(IProjectManager projectManager, string packageId, Version version, bool ignoreDependencies) { RunProjectAction(projectManager, () => projectManager.AddPackageReference(packageId, version, ignoreDependencies)); }