コード例 #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();
            }
        }
コード例 #2
0
        NuGetProject CreateNuGetProject(IMonoDevelopSolutionManager solutionManager, DotNetProject project)
        {
            if (solutionManager != null)
            {
                return(solutionManager.GetNuGetProject(new DotNetProjectProxy(project)));
            }

            return(new MonoDevelopNuGetProjectFactory().CreateNuGetProject(project));
        }
コード例 #3
0
        public static NuGetProject CreateNuGetProject(this DotNetProject project, IMonoDevelopSolutionManager solutionManager)
        {
            if (solutionManager != null)
            {
                var nugetProject = solutionManager.GetNuGetProject(new DotNetProjectProxy(project))
                                   .WithConsoleHostProjectServices(project);
            }

            return(new MonoDevelopNuGetProjectFactory()
                   .CreateNuGetProject(project)
                   .WithConsoleHostProjectServices(project));
        }
コード例 #4
0
		public UninstallNuGetPackageAction (
			IMonoDevelopSolutionManager solutionManager,
			IDotNetProject dotNetProject,
			INuGetProjectContext projectContext,
			INuGetPackageManager packageManager,
			IPackageManagementEvents packageManagementEvents)
		{
			this.dotNetProject = dotNetProject;
			this.context = projectContext;
			this.packageManager = packageManager;
			this.packageManagementEvents = packageManagementEvents;

			project = solutionManager.GetNuGetProject (dotNetProject);
		}
コード例 #5
0
        public UninstallNuGetPackagesAction(
            IMonoDevelopSolutionManager solutionManager,
            IDotNetProject dotNetProject,
            INuGetProjectContext projectContext,
            INuGetPackageManager packageManager,
            IPackageManagementEvents packageManagementEvents)
        {
            this.dotNetProject           = dotNetProject;
            this.context                 = projectContext;
            this.packageManager          = packageManager;
            this.packageManagementEvents = packageManagementEvents;

            project = solutionManager.GetNuGetProject(dotNetProject);
        }
コード例 #6
0
        public RestoreAndUninstallNuGetPackageAction(
            IMonoDevelopSolutionManager solutionManager,
            IDotNetProject dotNetProject)
        {
            this.dotNetProject = dotNetProject;

            nugetProject        = solutionManager.GetNuGetProject(dotNetProject) as MSBuildNuGetProject;
            packagePathResolver = new PackagePathResolver(nugetProject.GetPackagesFolderPath(solutionManager));

            restoreAction = new RestoreNuGetPackagesInProjectAction(
                dotNetProject.DotNetProject,
                nugetProject,
                solutionManager);

            uninstallAction = new UninstallNuGetPackageAction(solutionManager, dotNetProject);
        }
		public RestoreAndUninstallNuGetPackageAction (
			IMonoDevelopSolutionManager solutionManager,
			IDotNetProject dotNetProject)
		{
			this.dotNetProject = dotNetProject;

			nugetProject = solutionManager.GetNuGetProject (dotNetProject) as MSBuildNuGetProject;
			packagePathResolver = new PackagePathResolver (nugetProject.GetPackagesFolderPath (solutionManager));

			restoreAction = new RestoreNuGetPackagesInProjectAction (
				dotNetProject.DotNetProject,
				nugetProject,
				solutionManager);

			uninstallAction = new UninstallNuGetPackageAction (solutionManager, dotNetProject);
		}
コード例 #8
0
		public UpdateNuGetPackageAction (
			IMonoDevelopSolutionManager solutionManager,
			IDotNetProject dotNetProject,
			INuGetProjectContext projectContext,
			INuGetPackageManager packageManager,
			IPackageManagementEvents packageManagementEvents)
		{
			this.dotNetProject = dotNetProject;
			this.context = projectContext;
			this.packageManager = packageManager;
			this.packageManagementEvents = packageManagementEvents;

			project = solutionManager.GetNuGetProject (dotNetProject);

			sourceRepositoryProvider = solutionManager.CreateSourceRepositoryProvider ();
			primarySources = sourceRepositoryProvider.GetRepositories ().ToList ();
		}
コード例 #9
0
        public UpdateNuGetPackageAction(
            IMonoDevelopSolutionManager solutionManager,
            IDotNetProject dotNetProject,
            INuGetProjectContext projectContext,
            INuGetPackageManager packageManager,
            IPackageManagementEvents packageManagementEvents)
        {
            this.dotNetProject           = dotNetProject;
            this.context                 = projectContext;
            this.packageManager          = packageManager;
            this.packageManagementEvents = packageManagementEvents;

            project = solutionManager.GetNuGetProject(dotNetProject);

            sourceRepositoryProvider = solutionManager.CreateSourceRepositoryProvider();
            primarySources           = sourceRepositoryProvider.GetRepositories().ToList();
        }
        /// <summary>
        /// Execute will restore packages for all projects that transitively reference the project
        /// passed to the constructor of this restore action if this method is passed.
        /// </summary>
        void IncludeTransitiveProjectReferences()
        {
            var projects = project.DotNetProject.GetReferencingProjects();

            if (!projects.Any())
            {
                return;
            }

            referencingProjects = new List <BuildIntegratedNuGetProject> ();
            foreach (var referencingProject in projects)
            {
                var projectProxy        = new DotNetProjectProxy(referencingProject);
                var currentNuGetProject = solutionManager.GetNuGetProject(projectProxy) as BuildIntegratedNuGetProject;
                if (currentNuGetProject != null)
                {
                    referencingProjects.Add(currentNuGetProject);
                }
            }
        }
コード例 #11
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();
        }
コード例 #12
0
        public InstallNuGetPackageAction(
            IEnumerable <SourceRepository> primarySources,
            IEnumerable <SourceRepository> secondarySources,
            IMonoDevelopSolutionManager solutionManager,
            IDotNetProject dotNetProject,
            INuGetProjectContext projectContext,
            INuGetPackageManager packageManager,
            IPackageManagementEvents packageManagementEvents)
        {
            this.primarySources          = primarySources.ToList();
            this.secondarySources        = secondarySources?.ToList();
            this.dotNetProject           = dotNetProject;
            this.context                 = projectContext;
            this.packageManager          = packageManager;
            this.packageManagementEvents = packageManagementEvents;

            project = solutionManager.GetNuGetProject(dotNetProject);

            LicensesMustBeAccepted      = true;
            PreserveLocalCopyReferences = true;
            OpenReadmeFile = true;
        }
        public NuGetProject GetNuGetProject(string projectName)
        {
            string activeProjectName = GetActiveProjectName(projectName);

            return(solutionManager.GetNuGetProject(activeProjectName));
        }
コード例 #14
0
 public NuGetProject GetNuGetProject(IDotNetProject project)
 {
     return(solutionManager.GetNuGetProject(project));
 }
コード例 #15
0
		public InstallNuGetPackageAction (
			IEnumerable<SourceRepository> primarySources,
			IEnumerable<SourceRepository> secondarySources,
			IMonoDevelopSolutionManager solutionManager,
			IDotNetProject dotNetProject,
			INuGetProjectContext projectContext,
			INuGetPackageManager packageManager,
			IPackageManagementEvents packageManagementEvents)
		{
			this.primarySources = primarySources.ToList ();
			this.secondarySources = secondarySources?.ToList ();
			this.dotNetProject = dotNetProject;
			this.context = projectContext;
			this.packageManager = packageManager;
			this.packageManagementEvents = packageManagementEvents;

			project = solutionManager.GetNuGetProject (dotNetProject);

			LicensesMustBeAccepted = true;
			PreserveLocalCopyReferences = true;
			OpenReadmeFile = true;
		}
 public NuGetProject GetNuGetProject(string nuGetProjectSafeName)
 {
     return(solutionManager.GetNuGetProject(nuGetProjectSafeName));
 }
コード例 #17
0
 public void AddProject(IDotNetProject project)
 {
     dotNetProjects.Add(project);
     projects.Add(solutionManager.GetNuGetProject(project));
 }