Beispiel #1
0
        public AllPackagesViewModel(
            IMonoDevelopSolutionManager solutionManager,
            IDotNetProject dotNetProject,
            RecentNuGetPackagesRepository recentPackagesRepository)
        {
            this.solutionManager          = solutionManager;
            this.dotNetProject            = dotNetProject;
            this.recentPackagesRepository = recentPackagesRepository;
            PackageViewModels             = new ObservableCollection <PackageSearchResultViewModel> ();
            CheckedPackageViewModels      = new ObservableCollection <PackageSearchResultViewModel> ();
            ErrorMessage = String.Empty;

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

            if (dotNetProject.DotNetProject != null)
            {
                nugetProject = solutionManager.GetNuGetProject(dotNetProject);
                GetPackagesInstalledInProject();
            }
        }
Beispiel #2
0
        public static AllPackagesViewModel Create(RecentNuGetPackagesRepository recentPackagesRepository)
        {
            var solutionManager = new MonoDevelopSolutionManager(IdeApp.ProjectOperations.CurrentSelectedSolution);
            var dotNetProject   = new DotNetProjectProxy((DotNetProject)IdeApp.ProjectOperations.CurrentSelectedProject);

            return(new AllPackagesViewModel(solutionManager, dotNetProject, recentPackagesRepository));
        }
 public AllPackagesViewModel(
     IMonoDevelopSolutionManager solutionManager,
     IDotNetProject dotNetProject,
     RecentNuGetPackagesRepository recentPackagesRepository)
     : this(
         solutionManager,
         dotNetProject,
         new NuGetProjectContext(),
         recentPackagesRepository)
 {
 }
        public static AllPackagesViewModel Create(
            DotNetProject project,
            RecentNuGetPackagesRepository recentPackagesRepository)
        {
            if (project == null)
            {
                return(Create(recentPackagesRepository));
            }

            var solutionManager = PackageManagementServices.Workspace.GetSolutionManager(project.ParentSolution);
            var dotNetProject   = new DotNetProjectProxy(project);

            return(new AllPackagesViewModel(solutionManager, dotNetProject, recentPackagesRepository));
        }