Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 4
0
 private void AddPackageReference(IProjectManager projectManager, IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
 {
     RunProjectAction(projectManager, () => projectManager.AddPackageReference(package, ignoreDependencies, allowPrereleaseVersions));
 }
Ejemplo n.º 5
0
 private void AddPackageReference(IProjectManager projectManager, string packageId, SemanticVersion version, bool ignoreDependencies, bool allowPrereleaseVersions)
 {
     RunProjectAction(projectManager, () => projectManager.AddPackageReference(packageId, version, ignoreDependencies, allowPrereleaseVersions));
 }
Ejemplo n.º 6
0
 public void InstallPackage(String id, SemanticVersion version)
 {
     _projectManager.AddPackageReference(id, version, false, true);
 }
Ejemplo n.º 7
0
        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);
            }
        }
Ejemplo n.º 8
0
 private void AddPackageReference(IProjectManager projectManager, IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
 {
     RunProjectAction(projectManager, () => projectManager.AddPackageReference(package, ignoreDependencies, allowPrereleaseVersions));
 }
Ejemplo n.º 9
0
 private void AddPackageReference(IProjectManager projectManager, string packageId, SemanticVersion version, bool ignoreDependencies, bool allowPrereleaseVersions)
 {
     RunProjectAction(projectManager, () => projectManager.AddPackageReference(packageId, version, ignoreDependencies, allowPrereleaseVersions));
 }
Ejemplo n.º 10
0
 private void AddPackageReference(IProjectManager projectManager, string packageId, Version version, bool ignoreDependencies)
 {
     RunProjectAction(projectManager, () => projectManager.AddPackageReference(packageId, version, ignoreDependencies));
 }
Ejemplo n.º 11
0
 private void AddPackageReference(IProjectManager projectManager, string packageId, Version version, bool ignoreDependencies)
 {
     RunProjectAction(projectManager, () => projectManager.AddPackageReference(packageId, version, ignoreDependencies));
 }