private void UpdateVirtualRepos(IList <PackageAction> actions) { foreach (PackageAction action in actions) { PackageProjectAction action2 = action as PackageProjectAction; if (action2 != null) { VirtualRepository repository2 = this._virtualProjectRepos[action2.ProjectManager]; if (action2.ActionType == PackageActionType.Install) { repository2.AddPackage(action.Package); continue; } repository2.RemovePackage(action.Package); continue; } PackageSolutionAction action3 = (PackageSolutionAction)action; VirtualRepository repository = this._virtualPackageRepos[action3.PackageManager]; if (action3.ActionType == PackageActionType.AddToPackagesFolder) { repository.AddPackage(action3.Package); continue; } if (action3.ActionType == PackageActionType.DeleteFromPackagesFolder) { repository.RemovePackage(action3.Package); } } }
private IEnumerable <PackageOperation> ResolveOperationsToUninstallProjectLevelPackage(Operation operation) { VirtualRepository repository = this._virtualProjectRepos[operation.ProjectManager]; FrameworkName targetFrameworkForPackage = operation.ProjectManager.GetTargetFrameworkForPackage(operation.Package.Id); return(new UninstallWalker(repository, new DependentsWalker(repository, targetFrameworkForPackage), targetFrameworkForPackage, NullLogger.Instance, this.RemoveDependencies, this.ForceRemove).ResolveOperations(operation.Package)); }
private IEnumerable <PackageOperation> ResolveOperationsToUpdateSolutionLevelPackage(Operation operation) { VirtualRepository repository = this._virtualPackageRepos[operation.ProjectManager.PackageManager]; DependentsWalker dependentsResolver = new DependentsWalker(repository, null); dependentsResolver.DependencyVersion = this.DependencyVersion; UpdateWalker walker2 = new UpdateWalker(repository, operation.ProjectManager.PackageManager.DependencyResolver, dependentsResolver, NullConstraintProvider.Instance, null, this.Logger ?? NullLogger.Instance, !this.IgnoreDependencies, this.AllowPrereleaseVersions); walker2.AcceptedTargets = PackageTargets.All; walker2.DependencyVersion = this.DependencyVersion; IEnumerable <PackageOperation> enumerable = walker2.ResolveOperations(operation.Package); using (IEnumerator <PackageOperation> enumerator = enumerable.GetEnumerator()) { while (enumerator.MoveNext()) { enumerator.Current.Target = PackageOperationTarget.PackagesFolder; } } return(enumerable); }
public VirtualProjectManager(IProjectManager projectManager) { ProjectManager = projectManager; LocalRepository = new VirtualRepository(projectManager.LocalRepository); }
public VirtualProjectManager(IProjectManager projectManager) { ProjectManager = projectManager; LocalRepository = new VirtualRepository(projectManager.LocalRepository); }