Ejemplo n.º 1
0
        public static ManagePackagesViewModel Create(
            RecentManagedNuGetPackagesRepository recentPackagesRepository,
            IDotNetProject project)
        {
            var solutionManager = PackageManagementServices.Workspace.GetSolutionManager(IdeApp.ProjectOperations.CurrentSelectedSolution);
            var solution        = new SolutionProxy(IdeApp.ProjectOperations.CurrentSelectedSolution);

            return(new ManagePackagesViewModel(solutionManager, solution, recentPackagesRepository, project));
        }
Ejemplo n.º 2
0
 public ManagePackagesViewModel(
     IMonoDevelopSolutionManager solutionManager,
     ISolution solution,
     RecentManagedNuGetPackagesRepository recentPackagesRepository,
     IDotNetProject project)
     : this(
         solutionManager,
         solution,
         new NuGetProjectContext(),
         recentPackagesRepository,
         project)
 {
 }
Ejemplo n.º 3
0
        public ManagePackagesViewModel(
            IMonoDevelopSolutionManager solutionManager,
            ISolution solution,
            INuGetProjectContext projectContext,
            RecentManagedNuGetPackagesRepository recentPackagesRepository,
            IDotNetProject project)
        {
            this.solutionManager          = solutionManager;
            this.projectContext           = projectContext;
            this.recentPackagesRepository = recentPackagesRepository;
            IsManagingSolution            = project == null;
            PackageViewModels             = new ObservableCollection <ManagePackagesSearchResultViewModel> ();
            CheckedPackageViewModels      = new ObservableCollection <ManagePackagesSearchResultViewModel> ();
            ProjectViewModels             = new ObservableCollection <ManageProjectViewModel> ();
            ErrorMessage = String.Empty;
            PageSelected = ManagePackagesPage.Browse;

            if (project != null)
            {
                dotNetProjects = new List <IDotNetProject> ();
                dotNetProjects.Add(project);
            }
            else
            {
                dotNetProjects = solution.GetAllProjects().ToList();
            }

            packageManager = new NuGetPackageManager(
                solutionManager.CreateSourceRepositoryProvider(),
                solutionManager.Settings,
                solutionManager,
                new DeleteOnRestartManager()
                );

            nugetProjects = dotNetProjects
                            .Select(dotNetProject => solutionManager.GetNuGetProject(dotNetProject))
                            .ToList();

            GetPackagesInstalledInProjects().Ignore();
        }