Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ward <ward.matt@gmail.com>2014-02-03 19:34:08 +0400
committerMatt Ward <ward.matt@gmail.com>2014-02-03 19:34:08 +0400
commite04cc92054dcd98f290d29e581246a4492f8ff93 (patch)
tree4f8a47f7c5a74106b4f2ee7449c03c9caa7f921d
parentef5638443da8ea9ece74ce9e7dccaa13bcc4a246 (diff)
[NuGet] Add NuGet addin
-rw-r--r--main/Main.sln33
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MSBuildProjectExtensionsTests.cs216
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj66
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/Properties/AssemblyInfo.cs30
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AssemblyInfo.cs31
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs49
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackagesCommandHandler.cs58
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesHandler.cs93
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/HyperlinkWidget.cs78
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs63
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs134
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageLicenseWidget.cs58
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs52
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsWidget.cs81
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs53
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs225
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackagesWidget.cs325
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PagedResultsWidget.cs136
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/SelectProjectsDialog.cs122
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.addin.xml82
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj288
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AcceptLicensesEventArgs.cs45
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AggregateExceptionErrorMessage.cs68
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AvailablePackagesViewModel.cs92
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ConfigSettingsFileSystem.cs49
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DefaultProjectTemplatePackageSource.cs58
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DelegateCommand.cs67
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectExtensions.cs112
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs75
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FolderBrowser.cs45
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICommand.cs40
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICompilerMessageView.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFolderBrowser.cs37
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ILicenseAcceptanceService.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMachinePackageCache.cs41
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMessageViewCategory.cs38
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageAction.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageActionRunner.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageExtensions.cs56
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepository.cs41
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepositoryExtensions.cs54
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementEvents.cs57
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementFileService.cs38
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementOutputMessagesView.cs37
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProject.cs72
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectFactory.cs38
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectService.cs49
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSelectedProject.cs43
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSolution.cs59
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagerFactory.cs41
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageOperationResolverFactory.cs48
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryCache.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryExtensions.cs46
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryFactoryEvents.cs37
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelFactory.cs44
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelParent.cs37
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProcess.cs37
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProjectBrowserUpdater.cs36
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPropertyService.cs38
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRecentPackageRepository.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRegisteredPackageRepositories.cs46
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISelectProjectsService.cs38
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsFactory.cs38
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageManager.cs50
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageRepositoryFactory.cs48
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectManager.cs40
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectSystemFactory.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepository.cs49
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepositoryFactory.cs38
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITask.cs44
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITaskFactory.cs39
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IThreadSafePackageManagementEvents.cs36
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageActions.cs40
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageSettings.cs38
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackagesAction.cs43
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs58
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModel.cs89
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModelFactory.cs54
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackagesViewModel.cs102
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs52
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceViewModel.cs59
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildProjectExtensions.cs126
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MachinePackageCache.cs51
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesUserPrompts.cs124
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewModel.cs131
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs49
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MarkupString.cs43
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopCredentialProvider.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopHttpUserAgent.cs64
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetExePath.cs46
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetPackageRestoreCommandLine.cs92
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenDotNetProjects.cs65
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs85
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFiles.cs108
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFilesForOperations.cs61
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs221
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageLicenseViewModel.cs55
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementCompilerMessageView.cs51
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEnumerableExtensions.cs55
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEvents.cs130
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementFileService.cs47
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementLogger.cs53
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMessageViewCategory.cs52
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptions.cs99
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptionsViewModel.cs116
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOutputMessagesView.cs77
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProject.cs186
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectFactory.cs52
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectService.cs81
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementPropertyService.cs44
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProject.cs64
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProjects.cs181
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs113
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolution.cs207
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTask.cs88
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTaskFactory.cs46
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementViewModels.cs149
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationExceptionEventArgs.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessage.cs56
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessageLoggedEventArgs.cs46
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationsResolverFactory.cs62
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryCache.cs150
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryFactoryEventArgs.cs43
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceConverter.cs84
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceExtensions.cs41
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModel.cs63
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModel.cs539
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelFactory.cs73
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs124
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageResult.cs50
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModel.cs447
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModels.cs73
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Page.cs43
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Pages.cs180
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackageOperationEventArgs.cs43
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackagesOperationEventArgs.cs44
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Process.cs40
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs158
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs71
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectBrowserUpdater.cs68
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectExtensions.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFramework.cs93
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageRepositoryCache.cs99
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageSettingsFileName.cs47
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageInfo.cs70
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageRepository.cs195
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackagesViewModel.cs76
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReducedPackageOperations.cs77
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageRepositories.cs111
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSource.cs56
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs190
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs85
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourcesViewModel.cs285
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredProjectTemplatePackageSources.cs74
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs60
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ResolveFileConflictEventArgs.cs45
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsEventArgs.cs45
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs51
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsViewModel.cs61
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForInstalledPackages.cs45
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForUpdatedPackages.cs59
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsFactory.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManager.cs209
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManagerFactory.cs83
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageRepositoryFactory.cs69
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectManager.cs57
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystem.cs371
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystemFactory.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionExtensions.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepository.cs119
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryFactory.cs58
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryPath.cs72
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafePackageManagementEvents.cs207
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafeProjectBrowserUpdater.cs54
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs65
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs73
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesAction.cs114
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesActionFactory.cs97
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateSolutionPackagesAction.cs149
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModel.cs58
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModelFactory.cs55
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackages.cs100
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesViewModel.cs130
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UserAgentGeneratorForRepositoryRequests.cs60
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ViewModelBase.cs66
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.HyperlinkWidget.cs19
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs141
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.ManagePackagesDialog.cs143
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageLicenseWidget.cs90
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs211
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageSourcesWidget.cs216
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackagesWidget.cs539
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PagedResultsWidget.cs150
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.SelectProjectsDialog.cs95
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/generated.cs120
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/gui.stetic1746
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/icons/packageicon.pngbin0 -> 1865 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/lib/Microsoft.Web.XmlTransform.dllbin0 -> 84480 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/lib/NuGet-COPYRIGHT.txt13
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/lib/NuGet-LICENSE.txt177
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/lib/NuGet.Core.dllbin0 -> 536576 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/lib/NuGet.exebin0 -> 1039872 bytes
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/lib/nunit.framework.dllbin0 -> 147456 bytes
203 files changed, 18934 insertions, 0 deletions
diff --git a/main/Main.sln b/main/Main.sln
index c004ecd511..c9e9ebc4fb 100644
--- a/main/Main.sln
+++ b/main/Main.sln
@@ -167,6 +167,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CorApi2", "src\addins\MonoD
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.Debugger.Win32", "src\addins\MonoDevelop.Debugger.Win32\MonoDevelop.Debugger.Win32\MonoDevelop.Debugger.Win32.csproj", "{7E4B15FB-E8C4-419A-A31C-9310FD9062BD}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MonoDevelop.PackageManagement", "MonoDevelop.PackageManagement", "{98F4461F-84D0-4C57-A11F-47E871BD04A0}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.PackageManagement", "src\addins\MonoDevelop.PackageManagement\MonoDevelop.PackageManagement\MonoDevelop.PackageManagement.csproj", "{F218643D-2E74-4309-820E-206A54B7133F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.PackageManagement.Tests", "src\addins\MonoDevelop.PackageManagement\MonoDevelop.PackageManagement.Tests\MonoDevelop.PackageManagement.Tests.csproj", "{2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}"
+EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "contrib", "contrib", "{F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Debugger.Soft", "external\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft.csproj", "{372E8E3E-29D5-4B4D-88A2-4711CD628C4E}"
@@ -447,6 +453,18 @@ Global
{252117CA-0ABB-4F36-BFC8-DE23A8089BB9}.Release|Any CPU.Build.0 = Release|Any CPU
{252117CA-0ABB-4F36-BFC8-DE23A8089BB9}.Release|x86.ActiveCfg = Release|Any CPU
{252117CA-0ABB-4F36-BFC8-DE23A8089BB9}.Release|x86.Build.0 = Release|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Debug|x86.Build.0 = Debug|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Release|x86.ActiveCfg = Release|Any CPU
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Release|x86.Build.0 = Release|Any CPU
{27096E7F-C91C-4AC6-B289-6897A701DF21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27096E7F-C91C-4AC6-B289-6897A701DF21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27096E7F-C91C-4AC6-B289-6897A701DF21}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -1314,6 +1332,18 @@ Global
{EF91D0B8-53F6-4622-9F26-3ED27815878A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF91D0B8-53F6-4622-9F26-3ED27815878A}.Release|x86.ActiveCfg = Release|Any CPU
{EF91D0B8-53F6-4622-9F26-3ED27815878A}.Release|x86.Build.0 = Release|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.Debug|x86.Build.0 = Debug|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.Release|x86.ActiveCfg = Release|Any CPU
+ {F218643D-2E74-4309-820E-206A54B7133F}.Release|x86.Build.0 = Release|Any CPU
{F3AC14B0-3D1F-4B9B-95E8-384056060F33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3AC14B0-3D1F-4B9B-95E8-384056060F33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3AC14B0-3D1F-4B9B-95E8-384056060F33}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -1432,6 +1462,7 @@ Global
{8EE34CBC-5D7C-4BB3-8B19-26D5522770F6} = {D417E929-2B3A-46AC-BBE8-027ADB63A790}
{776872D9-76FA-407B-BA69-08E25A24E5CE} = {D417E929-2B3A-46AC-BBE8-027ADB63A790}
{8F47F5EC-2F57-4030-B658-7B1002DA90C2} = {D417E929-2B3A-46AC-BBE8-027ADB63A790}
+ {98F4461F-84D0-4C57-A11F-47E871BD04A0} = {D417E929-2B3A-46AC-BBE8-027ADB63A790}
{19DE0F35-D204-4FD8-A553-A19ECE05E24D} = {DEEB9163-3966-4E5E-9AB5-FBB3E01AC82A}
{183E084F-2C3B-4A6D-A8CE-6CDF3DC499AC} = {DEEB9163-3966-4E5E-9AB5-FBB3E01AC82A}
{0413DB7D-8B35-423F-9752-D75C9225E7DE} = {DEEB9163-3966-4E5E-9AB5-FBB3E01AC82A}
@@ -1473,6 +1504,8 @@ Global
{9FBCC262-10DC-4E84-A5C4-17230BBF8862} = {8F47F5EC-2F57-4030-B658-7B1002DA90C2}
{69136056-BFD3-4CEC-BB41-D9991C79593C} = {8F47F5EC-2F57-4030-B658-7B1002DA90C2}
{7E4B15FB-E8C4-419A-A31C-9310FD9062BD} = {8F47F5EC-2F57-4030-B658-7B1002DA90C2}
+ {F218643D-2E74-4309-820E-206A54B7133F} = {98F4461F-84D0-4C57-A11F-47E871BD04A0}
+ {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B} = {98F4461F-84D0-4C57-A11F-47E871BD04A0}
{372E8E3E-29D5-4B4D-88A2-4711CD628C4E} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{984CC812-9470-4A13-AFF9-CC44068D666C} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{A9AE40FF-1A21-414A-9FE7-3BE13644CC6D} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MSBuildProjectExtensionsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MSBuildProjectExtensionsTests.cs
new file mode 100644
index 0000000000..1251ff766a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MSBuildProjectExtensionsTests.cs
@@ -0,0 +1,216 @@
+
+using System;
+using System.Xml;
+using ICSharpCode.PackageManagement;
+using MonoDevelop.Projects.Formats.MSBuild;
+using NuGet;
+using NUnit.Framework;
+
+namespace MonoDevelop.PackageManagement.Tests
+{
+ [TestFixture]
+ public class MSBuildProjectExtensionsTests
+ {
+ MSBuildProject project;
+
+ void CreateProject ()
+ {
+ project = new MSBuildProject ();
+ }
+
+ void AddImportIfMissingAtBottom (string importFile, string condition = "")
+ {
+ project.AddImportIfMissing (importFile, ProjectImportLocation.Bottom, condition);
+ }
+
+ void AddImportIfMissingAtTop (string importFile, string condition = "")
+ {
+ project.AddImportIfMissing (importFile, ProjectImportLocation.Top, condition);
+ }
+
+ void AssertLastMSBuildImportElementHasProjectAttributeValue (string expectedAttributeValue)
+ {
+ XmlElement import = GetLastMSBuildImportElement ();
+ string actualAttributeValue = import.GetAttribute ("Project");
+ Assert.AreEqual (expectedAttributeValue, actualAttributeValue);
+ }
+
+ void AssertLastMSBuildImportElementHasCondition (string expectedCondition)
+ {
+ XmlElement import = GetLastMSBuildImportElement ();
+ string actualCondition = import.GetAttribute ("Condition");
+ Assert.AreEqual (expectedCondition, actualCondition);
+ }
+
+ XmlElement GetLastMSBuildImportElement()
+ {
+ var import = project.doc.DocumentElement.LastChild as XmlElement;
+ Assert.AreEqual (import.LocalName, "Import");
+ return import;
+ }
+
+ void AssertFirstMSBuildImportElementHasProjectAttributeValue (string expectedAttributeValue)
+ {
+ XmlElement import = GetFirstMSBuildImportElement ();
+ string actualAttributeValue = import.GetAttribute ("Project");
+ Assert.AreEqual (expectedAttributeValue, actualAttributeValue);
+ }
+
+ XmlElement GetFirstMSBuildImportElement()
+ {
+ var import = project.doc.DocumentElement.FirstChild as XmlElement;
+ Assert.AreEqual (import.LocalName, "Import");
+ return import;
+ }
+
+ void AssertFirstMSBuildImportElementHasCondition (string expectedCondition)
+ {
+ XmlElement import = GetFirstMSBuildImportElement ();
+ string actualCondition = import.GetAttribute ("Condition");
+ Assert.AreEqual (expectedCondition, actualCondition);
+ }
+
+ [Test]
+ public void AddImportIfMissing_RelativeImportFilePathAndBottomOfProject_ImportAddedAsLastImportInProject ()
+ {
+ CreateProject ();
+ string importFile = @"..\packages\Foo.0.1\build\Foo.targets";
+
+ AddImportIfMissingAtBottom (importFile);
+
+ AssertLastMSBuildImportElementHasProjectAttributeValue (@"..\packages\Foo.0.1\build\Foo.targets");
+ }
+
+ [Test]
+ public void AddImportIfMissing_AddImportToBottomOfProjectWithCondition_ImportAddedWithCondition ()
+ {
+ CreateProject ();
+ string importFile = @"..\packages\Foo.0.1\build\Foo.targets";
+ string condition = "Exists('..\\packages\\Foo.0.1\\build\\Foo.targets')";
+
+ AddImportIfMissingAtBottom (importFile, condition);
+
+ AssertLastMSBuildImportElementHasCondition (condition);
+ }
+
+ [Test]
+ public void ImportExists_ImportAlreadyExists_ReturnsTrue ()
+ {
+ string importFile = @"packages\Foo.0.1\build\Foo.targets";
+ AddImportIfMissingAtBottom (importFile);
+
+ bool exists = project.ImportExists (importFile);
+
+ Assert.IsTrue (exists);
+ }
+
+ [Test]
+ public void ImportExists_ImportDoesNotExist_ReturnsFalse ()
+ {
+ CreateProject ();
+ string importFile = @"packages\Foo.0.1\build\Foo.targets";
+
+ bool exists = project.ImportExists (importFile);
+
+ Assert.IsFalse (exists);
+ }
+
+ [Test]
+ public void ImportExists_DifferentImportExists_ReturnsFalse ()
+ {
+ string importFile = @"packages\Foo.0.1\build\Foo.targets";
+ AddImportIfMissingAtBottom ("different-import.targets");
+
+ bool exists = project.ImportExists (importFile);
+
+ Assert.IsFalse (exists);
+ }
+
+ [Test]
+ public void AddImportIfMissing_AddSameImportTwice_ImportOnlyAddedOnceToProject()
+ {
+ CreateProject ();
+ string import = @"packages\Foo.0.1\build\Foo.targets";
+ AddImportIfMissingAtBottom (import);
+
+ AddImportIfMissingAtBottom (import);
+
+ Assert.AreEqual (1, project.doc.DocumentElement.ChildNodes.Count);
+ }
+
+ [Test]
+ public void ImportExists_ImportExistsButtWithDifferentCase_ReturnsTrue ()
+ {
+ CreateProject ();
+ string import1 = @"packages\Foo.0.1\build\Foo.targets";
+ string import2 = @"packages\Foo.0.1\BUILD\FOO.TARGETS";
+ AddImportIfMissingAtBottom (import1);
+
+ bool exists = project.ImportExists (import2);
+
+ Assert.IsTrue (exists);
+ }
+
+ [Test]
+ public void RemoveImportIfExists_ImportAlreadyAddedToBottomOfProject_ImportRemoved ()
+ {
+ CreateProject ();
+ string import = @"packages\Foo.0.1\build\Foo.targets";
+ AddImportIfMissingAtBottom (import);
+
+ project.RemoveImportIfExists (import);
+
+ Assert.AreEqual (0, project.doc.DocumentElement.ChildNodes.Count);
+ }
+
+ [Test]
+ public void RemoveImportIfExists_ImportAlreadyWithDifferentCaseAddedToBottomOfProject_ImportRemoved ()
+ {
+ CreateProject ();
+ string import1 = @"d:\projects\MyProject\packages\Foo.0.1\build\Foo.targets";
+ AddImportIfMissingAtBottom (import1);
+ string import2 = @"d:\projects\MyProject\packages\Foo.0.1\BUILD\FOO.TARGETS";
+
+ project.RemoveImportIfExists (import2);
+
+ Assert.AreEqual (0, project.doc.DocumentElement.ChildNodes.Count);
+ }
+
+ [Test]
+ public void AddImportIfMissing_AddToTopOfProject_ImportAddedAsFirstChildElement ()
+ {
+ CreateProject ();
+ AddImportIfMissingAtBottom ("test.targets");
+ string import = @"..\packages\Foo.0.1\build\Foo.targets";
+
+ AddImportIfMissingAtTop (import);
+
+ AssertFirstMSBuildImportElementHasProjectAttributeValue (@"..\packages\Foo.0.1\build\Foo.targets");
+ }
+
+ [Test]
+ public void AddImportIfMissing_AddImportToTopOfProject_ImportAddedWithConditionThatChecksForExistenceOfTargetsFile ()
+ {
+ CreateProject ();
+ AddImportIfMissingAtTop ("test.targets");
+ string import = @"..\packages\Foo.0.1\build\Foo.targets";
+ string condition = "Exists('..\\packages\\Foo.0.1\\build\\Foo.targets')";
+
+ AddImportIfMissingAtTop (import, condition);
+
+ AssertFirstMSBuildImportElementHasCondition (condition);
+ }
+
+ [Test]
+ public void AddImportIfMissing_AddToTopOfProjectTwice_ImportAddedOnlyOnce ()
+ {
+ CreateProject ();
+ string import = @"..\packages\Foo.0.1\build\Foo.targets";
+ AddImportIfMissingAtTop (import);
+
+ AddImportIfMissingAtTop (import);
+
+ Assert.AreEqual (1, project.doc.DocumentElement.ChildNodes.Count);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj
new file mode 100644
index 0000000000..71fe0f03cb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
+ <PropertyGroup>
+ <ProjectGuid>{2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <OutputType>Library</OutputType>
+ <RootNamespace>MonoDevelop.PackageManagement.Tests</RootNamespace>
+ <AssemblyName>MonoDevelop.PackageManagement.Tests</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>Full</DebugType>
+ <Optimize>False</Optimize>
+ <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <DebugSymbols>False</DebugSymbols>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
+ <DefineConstants>TRACE</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework">
+ <HintPath>..\lib\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml" />
+ <Reference Include="NuGet.Core">
+ <HintPath>..\lib\NuGet.Core.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MSBuildProjectExtensionsTests.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\MonoDevelop.PackageManagement\MonoDevelop.PackageManagement.csproj">
+ <Project>{F218643D-2E74-4309-820E-206A54B7133F}</Project>
+ <Name>MonoDevelop.PackageManagement</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
+ <Project>{7525BB88-6142-4A26-93B9-A30C6983390A}</Project>
+ <Name>MonoDevelop.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/Properties/AssemblyInfo.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..cea543c928
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/Properties/AssemblyInfo.cs
@@ -0,0 +1,30 @@
+#region Using directives
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+#endregion
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("MonoDevelop.PackageManagement.Tests")]
+[assembly: AssemblyDescription("NuGet addin for MonoDevelop Tests")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MonoDevelop.PackageManagement.Tests")]
+[assembly: AssemblyCopyright("Copyright (C) 2012-2013 Matthew Ward")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+// This sets the default COM visibility of types in the assembly to invisible.
+// If you need to expose a type to COM, use [ComVisible(true)] on that type.
+[assembly: ComVisible(false)]
+
+// The assembly version has following format :
+//
+// Major.Minor.Build.Revision
+//
+// You can specify all the values or you can use the default the Revision and
+// Build Numbers by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0")]
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AssemblyInfo.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AssemblyInfo.cs
new file mode 100644
index 0000000000..df878e992e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AssemblyInfo.cs
@@ -0,0 +1,31 @@
+#region Using directives
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+#endregion
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("MonoDevelop.PackageManagement")]
+[assembly: AssemblyDescription("NuGet addin for MonoDevelop")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MonoDevelop.PackageManagement")]
+[assembly: AssemblyCopyright("Copyright (C) 2012-2013 Matthew Ward")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// This sets the default COM visibility of types in the assembly to invisible.
+// If you need to expose a type to COM, use [ComVisible(true)] on that type.
+[assembly: ComVisible(false)]
+
+// The assembly version has following format :
+//
+// Major.Minor.Build.Revision
+//
+// You can specify all the values or you can use the default the Revision and
+// Build Numbers by using the '*' as shown below:
+[assembly: AssemblyVersion("0.8")]
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs
new file mode 100644
index 0000000000..402e4c5597
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs
@@ -0,0 +1,49 @@
+//
+// ManagePackagesHandler.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using ICSharpCode.PackageManagement;
+using MonoDevelop.Ide;
+
+namespace MonoDevelop.PackageManagement.Commands
+{
+ public class ManagePackagesHandler : PackagesCommandHandler
+ {
+ protected override void Run ()
+ {
+ try {
+ var viewModels = new PackageManagementViewModels ();
+ IPackageManagementEvents packageEvents = PackageManagementServices.PackageManagementEvents;
+ var dialog = new ManagePackagesDialog (viewModels.ManagePackagesViewModel, packageEvents);
+ MessageService.ShowCustomDialog (dialog);
+ } catch (Exception ex) {
+ MessageService.ShowException (ex);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackagesCommandHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackagesCommandHandler.cs
new file mode 100644
index 0000000000..a95dd84f11
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackagesCommandHandler.cs
@@ -0,0 +1,58 @@
+//
+// PackagesCommandHandler.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Components.Commands;
+using MonoDevelop.Ide;
+using MonoDevelop.Projects;
+
+namespace MonoDevelop.PackageManagement.Commands
+{
+ public abstract class PackagesCommandHandler : CommandHandler
+ {
+ protected override void Update (CommandInfo info)
+ {
+ if (IsDotNetProjectSelected () || IsDotNetSolutionSelected()) {
+ info.Bypass = false;
+ } else {
+ info.Enabled = false;
+ info.Bypass = true;
+ }
+ }
+
+ bool IsDotNetProjectSelected ()
+ {
+ return IdeApp.ProjectOperations.CurrentSelectedProject is DotNetProject;
+ }
+
+ bool IsDotNetSolutionSelected ()
+ {
+ return IdeApp.ProjectOperations.CurrentSelectedSolution != null;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesHandler.cs
new file mode 100644
index 0000000000..bf807c7e94
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/RestorePackagesHandler.cs
@@ -0,0 +1,93 @@
+//
+// RestorePackagesHandler.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using ICSharpCode.PackageManagement;
+using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
+using MonoDevelop.Ide;
+using MonoDevelop.Ide.Gui;
+
+namespace MonoDevelop.PackageManagement.Commands
+{
+ public class RestorePackagesHandler : PackagesCommandHandler
+ {
+ IPackageManagementSolution solution;
+
+ public RestorePackagesHandler()
+ : this(PackageManagementServices.Solution)
+ {
+ }
+
+ public RestorePackagesHandler(IPackageManagementSolution solution)
+ {
+ this.solution = solution;
+ }
+
+ protected override void Run ()
+ {
+ IProgressMonitor progressMonitor = GetRunProcessMonitor();
+
+ try {
+ RestorePackages(progressMonitor);
+ } catch (Exception ex) {
+ progressMonitor.Log.WriteLine(ex.Message);
+ progressMonitor.Dispose();
+ }
+ }
+
+ IProgressMonitor GetRunProcessMonitor()
+ {
+ return IdeApp.Workbench.ProgressMonitors.GetOutputProgressMonitor(
+ "NuGet",
+ Stock.RunProgramIcon,
+ true,
+ true);
+ }
+
+ void RestorePackages(IProgressMonitor progressMonitor)
+ {
+ var commandLine = new NuGetPackageRestoreCommandLine(solution);
+
+ progressMonitor.Log.WriteLine(commandLine.ToString());
+
+ RestorePackages(progressMonitor, commandLine);
+ }
+
+ void RestorePackages(IProgressMonitor progressMonitor, NuGetPackageRestoreCommandLine commandLine)
+ {
+ Runtime.ProcessService.StartConsoleProcess(
+ commandLine.Command,
+ commandLine.Arguments,
+ commandLine.WorkingDirectory,
+ progressMonitor as IConsole,
+ (e, sender) => progressMonitor.Dispose()
+ );
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/HyperlinkWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/HyperlinkWidget.cs
new file mode 100644
index 0000000000..d42dc53f3c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/HyperlinkWidget.cs
@@ -0,0 +1,78 @@
+//
+// HyperlinkWidget.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+using MonoDevelop.Ide;
+
+namespace MonoDevelop.PackageManagement
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class HyperlinkWidget : Gtk.Bin
+ {
+ LinkButton linkButton;
+
+ public HyperlinkWidget (string uri, string label)
+ {
+ this.Build ();
+ AddLinkButton (uri, label);
+ }
+
+ public HyperlinkWidget ()
+ {
+ this.Build ();
+ AddLinkButton ();
+ }
+
+ void AddLinkButton (string uri = "", string label = "")
+ {
+ linkButton = new LinkButton (uri, label);
+ linkButton.Relief = ReliefStyle.None;
+ linkButton.CanFocus = false;
+ linkButton.SetAlignment (0, 0);
+ linkButton.Clicked += LinkButtonClicked;
+ this.Add (linkButton);
+ }
+
+ void LinkButtonClicked (object sender, EventArgs e)
+ {
+ DesktopService.ShowUrl (linkButton.Uri);
+ }
+
+ public string Uri {
+ get { return linkButton.Uri; }
+ set { linkButton.Uri = value; }
+ }
+
+ public string Label {
+ get { return linkButton.Label; }
+ set { linkButton.Label = value; }
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs
new file mode 100644
index 0000000000..5327c86e0f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs
@@ -0,0 +1,63 @@
+//
+// LicenseAcceptanceDialog.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using ICSharpCode.PackageManagement;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ public partial class LicenseAcceptanceDialog : Gtk.Dialog
+ {
+ LicenseAcceptanceViewModel viewModel;
+
+ public LicenseAcceptanceDialog (LicenseAcceptanceViewModel viewModel)
+ {
+ this.Build ();
+ this.viewModel = viewModel;
+ this.subTitleHBoxForSinglePackage.Visible = viewModel.HasOnePackage;
+ this.subTitleHBoxForMultiplePackages.Visible = viewModel.HasMultiplePackages;
+ AddPackages ();
+ }
+
+ void AddPackages ()
+ {
+ foreach (PackageLicenseViewModel package in viewModel.Packages) {
+ AddPackageWidget (package);
+ }
+ this.packagesVBox.ShowAll ();
+ }
+
+ void AddPackageWidget (PackageLicenseViewModel package)
+ {
+ var widget = new PackageLicenseWidget (package);
+ this.packagesVBox.Add (widget);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs
new file mode 100644
index 0000000000..ec08175f9e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs
@@ -0,0 +1,134 @@
+//
+// ManagePackagesDialog.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using Gtk;
+using ICSharpCode.PackageManagement;
+
+namespace MonoDevelop.PackageManagement
+{
+ public partial class ManagePackagesDialog : Gtk.Dialog
+ {
+ ManagePackagesViewModel viewModel;
+ IPackageManagementEvents packageManagementEvents;
+ string messagesExpanderDefaultLabel;
+
+ public ManagePackagesDialog (ManagePackagesViewModel viewModel, IPackageManagementEvents packageManagementEvents)
+ {
+ this.Build ();
+ this.messagesExpanderDefaultLabel = messagesExpander.Label;
+
+ this.viewModel = viewModel;
+ this.packageManagementEvents = packageManagementEvents;
+ AddPackageManagementEventHandlers ();
+ LoadViewModels ();
+ }
+
+ void AddPackageManagementEventHandlers ()
+ {
+ packageManagementEvents.PackageOperationMessageLogged += PackageOperationMessageLogged;
+ packageManagementEvents.PackageOperationError += PackageOperationError;
+ packageManagementEvents.PackageOperationsStarting += PackageOperationsStarting;
+ }
+
+ void RemovePackageManagementEventHandlers ()
+ {
+ packageManagementEvents.PackageOperationMessageLogged -= PackageOperationMessageLogged;
+ packageManagementEvents.PackageOperationError -= PackageOperationError;
+ packageManagementEvents.PackageOperationsStarting -= PackageOperationsStarting;
+ }
+
+ void PackageOperationMessageLogged (object sender, PackageOperationMessageLoggedEventArgs e)
+ {
+ AppendMessage (e.Message.ToString ());
+ }
+
+ void PackageOperationError (object sender, PackageOperationExceptionEventArgs e)
+ {
+ messagesExpander.Label = e.Exception.Message;
+ ResizeMessagesExpanderLabelWidthToFullDialogWidth ();
+ AppendMessage (e.Exception.Message);
+ }
+
+ void PackageOperationsStarting (object sender, EventArgs e)
+ {
+ ResetMessageExpanderLabelWidthToDefault ();
+ messagesExpander.Label = messagesExpanderDefaultLabel;
+ }
+
+ void AppendMessage (string message)
+ {
+ TextIter end = this.messagesTextView.Buffer.EndIter;
+ this.messagesTextView.Buffer.Insert (ref end, message + "\n");
+ }
+
+ void LoadViewModels ()
+ {
+ this.Title = viewModel.Title;
+
+ this.availablePackagesWidget.LoadViewModel (viewModel.AvailablePackagesViewModel);
+ this.installedPackagesWidget.LoadViewModel (viewModel.InstalledPackagesViewModel);
+ this.UpdatedPackagesWidget.LoadViewModel (viewModel.UpdatedPackagesViewModel);
+ this.recentPackagesWidget.LoadViewModel (viewModel.RecentPackagesViewModel);
+ }
+
+ public override void Destroy ()
+ {
+ viewModel.Dispose ();
+ RemovePackageManagementEventHandlers ();
+ base.Destroy ();
+ }
+
+ void MessagesExpanderActivated (object sender, EventArgs e)
+ {
+ var child = this.VBox [this.messagesExpander] as Box.BoxChild;
+ child.Expand = this.messagesExpander.Expanded;
+ }
+
+ void ResetMessageExpanderLabelWidthToDefault ()
+ {
+ messagesExpander.LabelWidget.WidthRequest = 0;
+ }
+
+ void ResizeMessagesExpanderLabelWidthToFullDialogWidth ()
+ {
+ var label = messagesExpander.LabelWidget as Label;
+ label.WidthRequest = GetDialogWidth () - 30;
+ label.Wrap = true;
+ }
+
+ int GetDialogWidth ()
+ {
+ int width;
+ int height;
+ GetSize (out width, out height);
+ return width;
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageLicenseWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageLicenseWidget.cs
new file mode 100644
index 0000000000..3a84ae9e05
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageLicenseWidget.cs
@@ -0,0 +1,58 @@
+//
+// PackageLicenseWidget.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using ICSharpCode.PackageManagement;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class PackageLicenseWidget : Gtk.Bin
+ {
+ public PackageLicenseWidget (PackageLicenseViewModel viewModel)
+ {
+ this.Build ();
+ this.DisplayPackage (viewModel);
+ }
+
+ void DisplayPackage (PackageLicenseViewModel viewModel)
+ {
+ this.packageIdLabel.Markup = GetPackageIdMarkup (viewModel.Id);
+ this.packageSummaryTextView.Buffer.Text = viewModel.Summary;
+ this.licenseHyperlinkWidget.Uri = viewModel.LicenseUrl.ToString ();
+ }
+
+ string GetPackageIdMarkup (string id)
+ {
+ string format = "<span weight='bold'>{0}</span>";
+ return MarkupString.Format (format, id);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs
new file mode 100644
index 0000000000..977256acc9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs
@@ -0,0 +1,52 @@
+//
+// PackageManagementOptionsPanel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using ICSharpCode.PackageManagement;
+using MonoDevelop.Ide.Gui.Dialogs;
+
+namespace MonoDevelop.PackageManagement.Gui
+{
+ public class PackageManagementOptionsPanel : OptionsPanel
+ {
+ PackageManagementOptionsViewModel optionsViewModel;
+
+ public override Gtk.Widget CreatePanelWidget()
+ {
+ var viewModels = new PackageManagementViewModels ();
+ optionsViewModel = viewModels.PackageManagementOptionsViewModel;
+ return new PackageManagementOptionsWidget (optionsViewModel);
+ }
+
+ public override void ApplyChanges()
+ {
+ optionsViewModel.SaveOptions ();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsWidget.cs
new file mode 100644
index 0000000000..251c520e2d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsWidget.cs
@@ -0,0 +1,81 @@
+//
+// PackageManagementOptionsWidget.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using ICSharpCode.PackageManagement;
+
+namespace MonoDevelop.PackageManagement
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class PackageManagementOptionsWidget : Gtk.Bin
+ {
+ PackageManagementOptionsViewModel viewModel;
+
+ public PackageManagementOptionsWidget (PackageManagementOptionsViewModel viewModel)
+ {
+ this.Build ();
+ this.viewModel = viewModel;
+ this.InitializeWidget ();
+ }
+
+ void InitializeWidget ()
+ {
+ this.restorePackagesCheckBox.Active = viewModel.IsPackageRestoreEnabled;
+ EnableButtons ();
+ }
+
+ void EnableButtons ()
+ {
+ this.clearRecentPackagesButton.Sensitive = !viewModel.HasNoRecentPackages;
+ this.clearPackagesCacheButton.Sensitive = !viewModel.HasNoCachedPackages;
+ }
+
+ protected void RestorePackagesCheckBoxToggled (object sender, EventArgs e)
+ {
+ viewModel.IsPackageRestoreEnabled = this.restorePackagesCheckBox.Active;
+ }
+
+ protected void ClearRecentPackagesButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.ClearRecentPackages ();
+ EnableButtons ();
+ }
+
+ protected void ClearPackagesCacheButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.ClearCachedPackages ();
+ EnableButtons ();
+ }
+
+ protected void BrowseButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.BrowseCachedPackages ();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs
new file mode 100644
index 0000000000..03957f870c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs
@@ -0,0 +1,53 @@
+//
+// PackageSourcesOptionPanel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using ICSharpCode.PackageManagement;
+using MonoDevelop.Ide.Gui.Dialogs;
+
+namespace MonoDevelop.PackageManagement.Gui
+{
+ public class PackageSourcesOptionsPanel : OptionsPanel
+ {
+ PackageManagementViewModels viewModels;
+
+ public override Gtk.Widget CreatePanelWidget()
+ {
+ viewModels = new PackageManagementViewModels ();
+ viewModels.RegisteredPackageSourcesViewModel.Load ();
+
+ return new PackageSourcesWidget (viewModels.RegisteredPackageSourcesViewModel);
+ }
+
+ public override void ApplyChanges()
+ {
+ viewModels.RegisteredPackageSourcesViewModel.Save ();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs
new file mode 100644
index 0000000000..ff26825061
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesWidget.cs
@@ -0,0 +1,225 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Linq;
+
+using Gtk;
+using ICSharpCode.PackageManagement;
+
+namespace MonoDevelop.PackageManagement
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class PackageSourcesWidget : Gtk.Bin
+ {
+ RegisteredPackageSourcesViewModel viewModel;
+ ListStore packageSourcesStore;
+ const int IsEnabledCheckBoxColumn = 0;
+ const int PackageSourceDescriptionColumn = 1;
+ const int PackageSourceViewModelColumn = 2;
+
+ public PackageSourcesWidget (RegisteredPackageSourcesViewModel viewModel)
+ {
+ this.Build ();
+ this.viewModel = viewModel;
+ this.InitializeTreeView ();
+ this.LoadPackageSources ();
+ this.viewModel.PackageSourceViewModels.CollectionChanged += PackageSourceViewModelsCollectionChanged;
+ UpdateEnabledButtons ();
+ }
+
+ void InitializeTreeView ()
+ {
+ packageSourcesStore = new ListStore (typeof (bool), typeof (string), typeof (PackageSourceViewModel));
+ packageSourcesTreeView.Model = packageSourcesStore;
+ packageSourcesTreeView.AppendColumn (CreateTreeViewColumn ());
+ packageSourcesTreeView.Selection.Changed += PackageSourcesTreeViewSelectionChanged;
+ }
+
+ TreeViewColumn CreateTreeViewColumn ()
+ {
+ var column = new TreeViewColumn ();
+
+ var checkBoxRenderer = new CellRendererToggle ();
+ checkBoxRenderer.Toggled += PackageSourceCheckBoxToggled;
+ column.PackStart (checkBoxRenderer, false);
+ column.AddAttribute (checkBoxRenderer, "active", IsEnabledCheckBoxColumn);
+
+ var textRenderer = new CellRendererText ();
+ column.PackStart (textRenderer, true);
+ column.AddAttribute (textRenderer, "markup", PackageSourceDescriptionColumn);
+
+ return column;
+ }
+
+ void LoadPackageSources ()
+ {
+ AddPackageSourcesToTreeView (viewModel.PackageSourceViewModels);
+ }
+
+ void AddPackageSourcesToTreeView (IEnumerable<PackageSourceViewModel> packageSourceViewModels)
+ {
+ foreach (PackageSourceViewModel packageSourceViewModel in packageSourceViewModels) {
+ AddPackageSourceToTreeView (packageSourceViewModel);
+ }
+ }
+
+ void AddPackageSourceToTreeView (PackageSourceViewModel packageSourceViewModel)
+ {
+ packageSourcesStore.AppendValues (packageSourceViewModel.IsEnabled, GetPackageSourceDescriptionMarkup (packageSourceViewModel), packageSourceViewModel);
+ }
+
+ string GetPackageSourceDescriptionMarkup (PackageSourceViewModel packageSourceViewModel)
+ {
+ string format = "{0}\n<span foreground='blue' underline='single'>{1}</span>";
+ return MarkupString.Format (format, packageSourceViewModel.Name, packageSourceViewModel.SourceUrl);
+ }
+
+ void PackageSourceCheckBoxToggled (object o, ToggledArgs args)
+ {
+ TreeIter iter;
+ packageSourcesStore.GetIterFromString (out iter, args.Path);
+ PackageSourceViewModel packageSourceViewModel = GetPackageSourceViewModel (iter);
+ packageSourceViewModel.IsEnabled = !packageSourceViewModel.IsEnabled;
+ packageSourcesStore.SetValue (iter, IsEnabledCheckBoxColumn, packageSourceViewModel.IsEnabled);
+ }
+
+ PackageSourceViewModel GetPackageSourceViewModel (TreeIter iter)
+ {
+ return packageSourcesStore.GetValue (iter, PackageSourceViewModelColumn) as PackageSourceViewModel;
+ }
+
+ void PackageSourcesTreeViewSelectionChanged (object sender, EventArgs e)
+ {
+ viewModel.SelectedPackageSourceViewModel = GetSelectedPackageSourceViewModel ();
+ UpdateEnabledButtons ();
+ }
+
+ PackageSourceViewModel GetSelectedPackageSourceViewModel ()
+ {
+ TreeIter iter;
+ if (packageSourcesTreeView.Selection.GetSelected (out iter)) {
+ return GetPackageSourceViewModel (iter);
+ }
+ return null;
+ }
+
+ void UpdateEnabledButtons ()
+ {
+ this.addButton.Sensitive = viewModel.CanAddPackageSource;
+ this.moveUpButton.Sensitive = viewModel.CanMovePackageSourceUp;
+ this.moveDownButton.Sensitive= viewModel.CanMovePackageSourceDown;
+ this.removeButton.Sensitive = viewModel.CanRemovePackageSource;
+ }
+
+ void PackageSourceViewModelsCollectionChanged (object sender, NotifyCollectionChangedEventArgs e)
+ {
+ switch (e.Action) {
+ case NotifyCollectionChangedAction.Add:
+ AddNewPackageSources (e);
+ break;
+ case NotifyCollectionChangedAction.Remove:
+ RemovePackageSources (e);
+ break;
+ case NotifyCollectionChangedAction.Move:
+ MovePackageSources (e);
+ break;
+ }
+
+ UpdateEnabledButtons ();
+ }
+
+ void AddNewPackageSources (NotifyCollectionChangedEventArgs e)
+ {
+ AddPackageSourcesToTreeView (e.NewItems.OfType<PackageSourceViewModel>());
+ }
+
+ void RemovePackageSources (NotifyCollectionChangedEventArgs e)
+ {
+ foreach (PackageSourceViewModel packageSourceViewModel in e.OldItems.OfType<PackageSourceViewModel>()) {
+ TreeIter iter = GetTreeIter (packageSourceViewModel);
+ packageSourcesStore.Remove (ref iter);
+ }
+ }
+
+ TreeIter GetTreeIter (PackageSourceViewModel packageSourceViewModel)
+ {
+ TreeIter foundIter = TreeIter.Zero;
+ packageSourcesStore.Foreach ((model, path, iter) => {
+ var currentViewModel = model.GetValue (iter, PackageSourceViewModelColumn) as PackageSourceViewModel;
+ if (currentViewModel == packageSourceViewModel) {
+ foundIter = iter;
+ return true;
+ }
+ return false;
+ });
+ return foundIter;
+ }
+
+ void MovePackageSources (NotifyCollectionChangedEventArgs e)
+ {
+ TreeIter sourceIter = GetTreeIter (e.NewItems[0] as PackageSourceViewModel);
+ TreeIter destinationIter = GetTreeIter (e.NewStartingIndex);
+ packageSourcesStore.Swap (sourceIter, destinationIter);
+ }
+
+ TreeIter GetTreeIter (int index)
+ {
+ TreeIter foundIter = TreeIter.Zero;
+ int currentIndex = 0;
+ packageSourcesStore.Foreach ((model, path, iter) => {
+ if (currentIndex == index) {
+ foundIter = iter;
+ return true;
+ }
+ currentIndex++;
+ return false;
+ });
+ return foundIter;
+ }
+
+ void MoveUpButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.MovePackageSourceUp ();
+ UpdateEnabledButtons ();
+ }
+
+ void MoveDownButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.MovePackageSourceDown ();
+ UpdateEnabledButtons ();
+ }
+
+ void RemoveButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.RemovePackageSource ();
+ UpdateEnabledButtons ();
+ }
+
+ void AddButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.AddPackageSource ();
+ UpdateEnabledButtons ();
+ }
+
+ void BrowseButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.BrowsePackageFolder ();
+ this.packageSourceNameTextBox.Text = viewModel.NewPackageSourceName;
+ this.packageSourceTextBox.Text = viewModel.NewPackageSourceUrl;
+ UpdateEnabledButtons ();
+ }
+
+ void PackageSourceNameTextBoxChanged (object sender, EventArgs e)
+ {
+ viewModel.NewPackageSourceName = this.packageSourceNameTextBox.Text;
+ UpdateEnabledButtons ();
+ }
+
+ void PackageSourceTextBoxChanged (object sender, EventArgs e)
+ {
+ viewModel.NewPackageSourceUrl = this.packageSourceTextBox.Text;
+ UpdateEnabledButtons ();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackagesWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackagesWidget.cs
new file mode 100644
index 0000000000..90756a3990
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackagesWidget.cs
@@ -0,0 +1,325 @@
+//
+// ManagePackagesDialog.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+
+using Gdk;
+using Gtk;
+using ICSharpCode.PackageManagement;
+using MonoDevelop.Ide;
+using NuGet;
+
+namespace MonoDevelop.PackageManagement
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class PackagesWidget : Gtk.Bin
+ {
+ PackagesViewModel viewModel;
+ List<PackageSource> packageSources;
+ ListStore packageStore;
+ CellRendererText treeViewColumnTextRenderer;
+ const int PackageViewModelColumn = 2;
+
+ public PackagesWidget ()
+ {
+ this.Build ();
+ this.InitializeTreeView ();
+ }
+
+ void InitializeTreeView ()
+ {
+ packageStore = new ListStore (typeof (Pixbuf), typeof (string), typeof(PackageViewModel));
+ packagesTreeView.Model = packageStore;
+ packagesTreeView.AppendColumn (CreateTreeViewColumn ());
+ packagesTreeView.Selection.Changed += PackagesTreeViewSelectionChanged;
+ includePrereleaseCheckButton.Clicked += IncludePrereleaseCheckButtonClicked;
+
+ AddSearchingMessageToTreeView ();
+ }
+
+ TreeViewColumn CreateTreeViewColumn ()
+ {
+ var column = new TreeViewColumn ();
+
+ var iconRenderer = new CellRendererPixbuf ();
+ column.PackStart (iconRenderer, false);
+ column.AddAttribute (iconRenderer, "pixbuf", column: 0);
+
+ treeViewColumnTextRenderer = new CellRendererText ();
+ treeViewColumnTextRenderer.WrapMode = Pango.WrapMode.Word;
+ treeViewColumnTextRenderer.WrapWidth = 250;
+
+ column.PackStart (treeViewColumnTextRenderer, true);
+ column.AddAttribute (treeViewColumnTextRenderer, "markup", column: 1);
+
+ return column;
+ }
+
+ void AddSearchingMessageToTreeView ()
+ {
+ packageStore.AppendValues (
+ ImageService.GetPixbuf (Gtk.Stock.Info, IconSize.LargeToolbar),
+ Mono.Unix.Catalog.GetString ("Searching..."),
+ null);
+ }
+
+ void PackagesTreeViewSelectionChanged (object sender, EventArgs e)
+ {
+ ShowSelectedPackage ();
+ }
+
+ void IncludePrereleaseCheckButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.IncludePrerelease = !viewModel.IncludePrerelease;
+ }
+
+ public void LoadViewModel (PackagesViewModel viewModel)
+ {
+ this.viewModel = viewModel;
+
+ this.includePrereleaseCheckButton.Visible = viewModel.ShowPrerelease;
+
+ this.packageSearchHBox.Visible = viewModel.IsSearchable;
+ ClearSelectedPackageInformation ();
+ PopulatePackageSources ();
+ viewModel.PropertyChanged += ViewModelPropertyChanged;
+
+ this.pagedResultsWidget.LoadPackagesViewModel (viewModel);
+ this.pagedResultsHBox.Visible = viewModel.IsPaged;
+
+ this.updateAllPackagesButtonBox.Visible = viewModel.IsUpdateAllPackagesEnabled;
+ }
+
+ List<PackageSource> PackageSources {
+ get {
+ if (packageSources == null) {
+ packageSources = viewModel.PackageSources.ToList ();
+ }
+ return packageSources;
+ }
+ }
+
+ void PopulatePackageSources ()
+ {
+ this.packageSourceComboBox.Visible = viewModel.ShowPackageSources;
+ if (viewModel.ShowPackageSources) {
+ for (int index = 0; index < PackageSources.Count; ++index) {
+ PackageSource packageSource = PackageSources [index];
+ this.packageSourceComboBox.InsertText (index, packageSource.Name);
+ }
+
+ this.packageSourceComboBox.Active = GetSelectedPackageSourceIndexFromViewModel ();
+ }
+ }
+
+ int GetSelectedPackageSourceIndexFromViewModel ()
+ {
+ if (viewModel.SelectedPackageSource == null) {
+ return -1;
+ }
+
+ return PackageSources.IndexOf (viewModel.SelectedPackageSource);
+ }
+
+ void PackageSourceChanged (object sender, EventArgs e)
+ {
+ viewModel.SelectedPackageSource = GetSelectedPackageSource ();
+ }
+
+ PackageSource GetSelectedPackageSource ()
+ {
+ if (this.packageSourceComboBox.Active == -1) {
+ return null;
+ }
+
+ return PackageSources [this.packageSourceComboBox.Active];
+ }
+
+ void SearchButtonClicked (object sender, EventArgs e)
+ {
+ Search ();
+ }
+
+ void Search ()
+ {
+ viewModel.SearchTerms = this.packageSearchEntry.Text;
+ viewModel.SearchCommand.Execute (null);
+ }
+
+ void ShowSelectedPackage ()
+ {
+ PackageViewModel packageViewModel = GetSelectedPackageViewModel ();
+ if (packageViewModel != null) {
+ ShowPackageInformation (packageViewModel);
+ } else {
+ ClearSelectedPackageInformation ();
+ }
+ }
+
+ PackageViewModel GetSelectedPackageViewModel ()
+ {
+ TreeIter item;
+ if (packagesTreeView.Selection.GetSelected (out item)) {
+ return packageStore.GetValue (item, PackageViewModelColumn) as PackageViewModel;
+ }
+ return null;
+ }
+
+ void ShowPackageInformation (PackageViewModel packageViewModel)
+ {
+ this.packageVersionTextBox.Text = packageViewModel.Version.ToString ();
+ this.packageCreatedByTextBox.Text = packageViewModel.GetAuthors ();
+ this.packageLastUpdatedTextBox.Text = packageViewModel.GetLastPublishedDisplayText ();
+ this.packageDownloadsTextBox.Text = packageViewModel.GetDownloadCountDisplayText ();
+ this.packageDescriptionTextView.Buffer.Text = packageViewModel.Description;
+ this.packageIdTextBox.Text = packageViewModel.Id;
+ this.packageIdTextBox.Visible = packageViewModel.HasNoGalleryUrl;
+ ShowUri (this.packageIdButton, packageViewModel.GalleryUrl, packageViewModel.Id);
+ ShowUri (this.moreInformationButton, packageViewModel.ProjectUrl);
+ ShowUri (this.viewLicenseTermsButton, packageViewModel.LicenseUrl);
+ this.packageDependenciesListHBox.Visible = packageViewModel.HasDependencies;
+ this.packageDependenciesNoneLabel.Visible = !packageViewModel.HasDependencies;
+ this.packageDependenciesListLabel.Text = packageViewModel.GetPackageDependenciesDisplayText ();
+
+ EnablePackageActionButtons (packageViewModel);
+
+ this.packageInfoFrameVBox.Visible = true;
+ this.managePackageButtonBox.Visible = true;
+ }
+
+ void ClearSelectedPackageInformation ()
+ {
+ this.packageInfoFrameVBox.Visible = false;
+ this.managePackageButtonBox.Visible = false;
+ }
+
+ void ShowUri (HyperlinkWidget hyperlinkWidget, Uri uri, string label)
+ {
+ hyperlinkWidget.Label = label;
+ ShowUri (hyperlinkWidget, uri);
+ }
+
+ void ShowUri (HyperlinkWidget hyperlinkWidget, Uri uri)
+ {
+ if (uri == null) {
+ hyperlinkWidget.Visible = false;
+ } else {
+ hyperlinkWidget.Visible = true;
+ hyperlinkWidget.Uri = uri.ToString ();
+ }
+ }
+
+ void EnablePackageActionButtons (PackageViewModel packageViewModel)
+ {
+ this.addPackageButton.Visible = !packageViewModel.IsManaged;
+ this.removePackageButton.Visible = !packageViewModel.IsManaged;
+ this.managePackageButton.Visible = packageViewModel.IsManaged;
+
+ this.addPackageButton.Sensitive = !packageViewModel.IsAdded;
+ this.removePackageButton.Sensitive = packageViewModel.IsAdded;
+ }
+
+ void ViewModelPropertyChanged (object sender, PropertyChangedEventArgs e)
+ {
+ this.packageStore.Clear ();
+
+ if (viewModel.HasError) {
+ AddErrorToTreeView ();
+ }
+
+ if (viewModel.IsReadingPackages) {
+ AddSearchingMessageToTreeView ();
+ }
+
+ foreach (PackageViewModel packageViewModel in viewModel.PackageViewModels) {
+ AppendPackageToTreeView (packageViewModel);
+ }
+
+ this.pagedResultsHBox.Visible = viewModel.IsPaged;
+ this.updateAllPackagesButtonBox.Visible = viewModel.IsUpdateAllPackagesEnabled;
+ }
+
+ void AddErrorToTreeView ()
+ {
+ packageStore.AppendValues (
+ ImageService.GetPixbuf (Gtk.Stock.DialogError, IconSize.LargeToolbar),
+ viewModel.ErrorMessage,
+ null);
+ }
+
+ void PackageSearchEntryActivated (object sender, EventArgs e)
+ {
+ Search ();
+ }
+
+ void AppendPackageToTreeView (PackageViewModel packageViewModel)
+ {
+ packageStore.AppendValues (
+ ImageService.GetPixbuf ("md-nuget-package", IconSize.Dnd),
+ packageViewModel.GetDisplayTextMarkup (),
+ packageViewModel);
+ }
+
+ void OnAddPackageButtonClicked (object sender, EventArgs e)
+ {
+ PackageViewModel packageViewModel = GetSelectedPackageViewModel ();
+ packageViewModel.AddPackage ();
+ EnablePackageActionButtons (packageViewModel);
+ }
+
+ void RemovePackageButtonClicked (object sender, EventArgs e)
+ {
+ PackageViewModel packageViewModel = GetSelectedPackageViewModel ();
+ packageViewModel.RemovePackage ();
+ EnablePackageActionButtons (packageViewModel);
+ }
+
+ void ManagePackagesButtonClicked (object sender, EventArgs e)
+ {
+ PackageViewModel packageViewModel = GetSelectedPackageViewModel ();
+ packageViewModel.ManagePackage ();
+ }
+
+ void UpdateAllPackagesButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.UpdateAllPackagesCommand.Execute (null);
+ }
+
+ protected override void OnDestroyed ()
+ {
+ if (viewModel != null) {
+ viewModel.PropertyChanged -= ViewModelPropertyChanged;
+ }
+ base.OnDestroyed ();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PagedResultsWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PagedResultsWidget.cs
new file mode 100644
index 0000000000..a596b7d59e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PagedResultsWidget.cs
@@ -0,0 +1,136 @@
+//
+// PagedResultsWidget.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using Gtk;
+using ICSharpCode.PackageManagement;
+using System.ComponentModel;
+
+namespace MonoDevelop.PackageManagement
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class PagedResultsWidget : Gtk.Bin
+ {
+ PackagesViewModel viewModel;
+ List<Button> buttons;
+
+ public PagedResultsWidget ()
+ {
+ this.Build ();
+ AddButtons ();
+ }
+
+ void AddButtons ()
+ {
+ buttons = new List<Button> ();
+ buttons.AddRange (new [] {
+ firstButton,
+ secondButton,
+ thirdButton,
+ fourthButton,
+ fifthButton
+ });
+ }
+
+ public void LoadPackagesViewModel (PackagesViewModel viewModel)
+ {
+ this.viewModel = viewModel;
+ this.viewModel.PropertyChanged += ViewModelPropertyChanged;
+ }
+
+ void ViewModelPropertyChanged (object sender, PropertyChangedEventArgs e)
+ {
+ UpdatePages ();
+ }
+
+ void UpdatePages ()
+ {
+ if (viewModel.IsPaged) {
+ this.backButton.Visible = viewModel.HasPreviousPage;
+ this.forwardButton.Visible = viewModel.HasNextPage;
+ UpdateButtonPageNumbers ();
+ }
+ }
+
+ void UpdateButtonPageNumbers ()
+ {
+ for (int index = 0; index < buttons.Count; ++index) {
+ Button button = buttons [index];
+ if (index < viewModel.Pages.Count) {
+ Page page = viewModel.Pages [index];
+ SetButtonPageNumber (button, page);
+ } else {
+ button.Visible = false;
+ }
+ }
+ }
+
+ void SetButtonPageNumber (Button button, Page page)
+ {
+ if (page.IsSelected) {
+ string markup = String.Format ("<b>{0}</b>", page.Number);
+ SetButtonText (button, markup);
+ } else {
+ SetButtonText (button, page.Number.ToString ());
+ }
+ }
+
+ void SetButtonText (Button button, string markup)
+ {
+ Label label = (Label) button.Child;
+ label.Markup = markup;
+ }
+
+ protected void BackButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.ShowPreviousPage ();
+ }
+
+ protected void ForwardButtonClicked (object sender, EventArgs e)
+ {
+ viewModel.ShowNextPage ();
+ }
+
+ protected void PageButtonClicked (object sender, EventArgs e)
+ {
+ Button button = (Button) sender;
+ int index = buttons.IndexOf (button);
+ viewModel.ShowPage (viewModel.Pages [index].Number);
+ }
+
+ protected override void OnDestroyed ()
+ {
+ if (viewModel != null) {
+ viewModel.PropertyChanged -= ViewModelPropertyChanged;
+ }
+ base.OnDestroyed ();
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/SelectProjectsDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/SelectProjectsDialog.cs
new file mode 100644
index 0000000000..5c3f11168b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/SelectProjectsDialog.cs
@@ -0,0 +1,122 @@
+//
+// SelectProjectsDialog.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Gtk;
+using ICSharpCode.PackageManagement;
+
+namespace MonoDevelop.PackageManagement
+{
+ public partial class SelectProjectsDialog : Gtk.Dialog
+ {
+ SelectProjectsViewModel viewModel;
+ ListStore projectsStore;
+ const int SelectedCheckBoxColumn = 0;
+ const int SelectedProjectNameColumn = 1;
+ const int SelectedProjectColumn = 2;
+
+ public SelectProjectsDialog (SelectProjectsViewModel viewModel)
+ {
+ this.Build ();
+ this.viewModel = viewModel;
+ InitializeTreeView ();
+ AddProjectsToTreeView ();
+ }
+
+ void InitializeTreeView ()
+ {
+ projectsStore = new ListStore (typeof (bool), typeof (string), typeof (IPackageManagementSelectedProject));
+ projectsTreeView.Model = projectsStore;
+ projectsTreeView.AppendColumn (CreateTreeViewColumn ());
+ projectsTreeView.Selection.Changed += ProjectsTreeViewSelectionChanged;
+ }
+
+ TreeViewColumn CreateTreeViewColumn ()
+ {
+ var column = new TreeViewColumn ();
+
+ var checkBoxRenderer = new CellRendererToggle ();
+ checkBoxRenderer.Toggled += SelectedProjectCheckBoxToggled;
+ column.PackStart (checkBoxRenderer, false);
+ column.AddAttribute (checkBoxRenderer, "active", SelectedCheckBoxColumn);
+
+ var textRenderer = new CellRendererText ();
+ column.PackStart (textRenderer, true);
+ column.AddAttribute (textRenderer, "markup", SelectedProjectNameColumn);
+
+ return column;
+ }
+
+ void ProjectsTreeViewSelectionChanged (object sender, EventArgs e)
+ {
+ TreeIter iter;
+ if (projectsTreeView.Selection.GetSelected (out iter)) {
+ var project = projectsStore.GetValue (iter, SelectedProjectColumn) as IPackageManagementSelectedProject;
+ if (!project.IsEnabled) {
+ projectsTreeView.Selection.UnselectIter (iter);
+ }
+ }
+ }
+
+ void SelectedProjectCheckBoxToggled (object o, ToggledArgs args)
+ {
+ TreeIter iter;
+ projectsStore.GetIterFromString (out iter, args.Path);
+ var project = projectsStore.GetValue (iter, SelectedProjectColumn) as IPackageManagementSelectedProject;
+ if (project.IsEnabled) {
+ project.IsSelected = !project.IsSelected;
+ projectsStore.SetValue (iter, SelectedCheckBoxColumn, project.IsSelected);
+ }
+ }
+
+ void AddProjectsToTreeView ()
+ {
+ foreach (IPackageManagementSelectedProject project in viewModel.Projects) {
+ AddProjectToTreeView (project);
+ }
+ }
+
+ void AddProjectToTreeView (IPackageManagementSelectedProject project)
+ {
+ projectsStore.AppendValues (project.IsSelected, GetProjectNameMarkup (project), project);
+ }
+
+ string GetProjectNameMarkup (IPackageManagementSelectedProject project)
+ {
+ if (project.IsEnabled) {
+ return project.Name;
+ }
+
+ string format = "<span foreground='lightgrey'>{0}</span>";
+ return MarkupString.Format (format, project.Name);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.addin.xml b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.addin.xml
new file mode 100644
index 0000000000..458cce57c2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.addin.xml
@@ -0,0 +1,82 @@
+<Addin name = "NuGet Package Management"
+ id = "PackageManagement"
+ namespace = "MonoDevelop"
+ author = "Matt Ward"
+ copyright = "MIT X11"
+ url = "https://github.com/mrward/monodevelop-nuget-addin"
+ description = "Provides support for adding and maintaining NuGet packages in your project. Updated to use NuGet 2.7.2"
+ category = "IDE extensions"
+ version = "4.2.3">
+
+ <Header>
+ <ReleaseNotesFile>ReleaseNotes.txt</ReleaseNotesFile>
+ </Header>
+
+ <Runtime>
+ <Import assembly="MonoDevelop.PackageManagement.dll" />
+ <Import assembly="Microsoft.Web.XmlTransform.dll" />
+ <Import assembly="NuGet.Core.dll" />
+ <Import file="NuGet.exe" />
+ </Runtime>
+
+ <Dependencies>
+ <Addin id="Core" version="4.2.3"/>
+ <Addin id="Ide" version="4.2.3"/>
+ </Dependencies>
+
+ <Extension path = "/MonoDevelop/Ide/Commands/Project">
+ <Command
+ id = "MonoDevelop.PackageManagement.Commands.ManagePackages"
+ _description = "Manage NuGet packages"
+ _label = "_Manage NuGet Packages..."
+ defaultHandler = "MonoDevelop.PackageManagement.Commands.ManagePackagesHandler" />
+ <Command
+ id = "MonoDevelop.PackageManagement.Commands.RestorePackages"
+ _description = "Restore NuGet packages"
+ _label = "_Restore NuGet Packages"
+ defaultHandler = "MonoDevelop.PackageManagement.Commands.RestorePackagesHandler" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/MainMenu/Project">
+ <CommandItem
+ id = "MonoDevelop.PackageManagement.Commands.ManagePackages"
+ insertafter = "MonoDevelop.Ide.Commands.ProjectCommands.AddReference"
+ insertbefore = "ExportSeparator" />
+ <CommandItem
+ id = "MonoDevelop.PackageManagement.Commands.RestorePackages"
+ insertafter = "MonoDevelop.PackageManagement.Commands.ManagePackages"
+ insertbefore = "ExportSeparator" />
+ </Extension>
+
+ <Extension path = "/MonoDevelop/Ide/ContextMenu/ProjectPad">
+ <Condition id="ItemType" value="Solution|Project|ProjectReferenceCollection">
+ <CommandItem
+ id = "MonoDevelop.PackageManagement.Commands.ManagePackages"
+ insertafter = "MonoDevelop.Ide.Commands.ProjectCommands.AddReference"
+ insertbefore = "AddSectionEnd" />
+ <CommandItem
+ id = "MonoDevelop.PackageManagement.Commands.RestorePackages"
+ insertafter = "MonoDevelop.PackageManagement.Commands.ManagePackages"
+ insertbefore = "AddSectionEnd" />
+ </Condition>
+ </Extension>
+
+ <Extension path="/MonoDevelop/Core/StockIcons">
+ <StockIcon stockid="md-nuget-package" resource="packageicon.png" />
+ </Extension>
+
+ <Extension path="/MonoDevelop/Ide/GlobalOptionsDialog">
+ <Section id="NuGetPackageManagement" _label="NuGet">
+ <Section
+ id="General"
+ _label="General"
+ fill="true"
+ class="MonoDevelop.PackageManagement.Gui.PackageManagementOptionsPanel" />
+ <Section
+ id="PackageSources"
+ _label="Package Sources"
+ fill="true"
+ class="MonoDevelop.PackageManagement.Gui.PackageSourcesOptionsPanel" />
+ </Section>
+ </Extension>
+</Addin>
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
new file mode 100644
index 0000000000..5d046a9168
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
+ <PropertyGroup>
+ <ProjectGuid>{F218643D-2E74-4309-820E-206A54B7133F}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <OutputType>Library</OutputType>
+ <RootNamespace>MonoDevelop.PackageManagement</RootNamespace>
+ <AssemblyName>MonoDevelop.PackageManagement</AssemblyName>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
+ <NoStdLib>False</NoStdLib>
+ <WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <RegisterForComInterop>False</RegisterForComInterop>
+ <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
+ <BaseAddress>4194304</BaseAddress>
+ <FileAlignment>4096</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <OutputPath>..\..\bin</OutputPath>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>Full</DebugType>
+ <Optimize>False</Optimize>
+ <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+ <OutputPath>..\..\bin</OutputPath>
+ <DebugSymbols>false</DebugSymbols>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
+ <DefineConstants>TRACE</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.PackageManagement</OutputPath>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.PackageManagement</OutputPath>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml" />
+ <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference Include="Mono.Posix" />
+ <Reference Include="NuGet.Core">
+ <HintPath>..\lib\NuGet.Core.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AssemblyInfo.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Commands\ManagePackagesHandler.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Commands\PackagesCommandHandler.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Commands\RestorePackagesHandler.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\AcceptLicensesEventArgs.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\AggregateExceptionErrorMessage.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\AvailablePackagesViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ConfigSettingsFileSystem.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\DefaultProjectTemplatePackageSource.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\DelegateCommand.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\DotNetProjectExtensions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\FileConflictResolver.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\FolderBrowser.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ICommand.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ICompilerMessageView.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IFolderBrowser.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ILicenseAcceptanceService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IMachinePackageCache.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IMessageViewCategory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\InstalledPackagesViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\InstalledPackageViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\InstalledPackageViewModelFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\InstallPackageAction.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageAction.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageActionRunner.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageExtensions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageFromRepository.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageFromRepositoryExtensions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageManagementEvents.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageManagementFileService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageManagementOutputMessagesView.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageManagementProject.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageManagementProjectFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageManagementProjectService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageManagementSelectedProject.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageManagementSolution.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageManagerFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageOperationResolverFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageRepositoryCache.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageRepositoryExtensions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageRepositoryFactoryEvents.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageViewModelFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPackageViewModelParent.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IProcess.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IProjectBrowserUpdater.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IPropertyService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IRecentPackageRepository.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IRegisteredPackageRepositories.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ISelectProjectsService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ISettingsFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ISharpDevelopPackageManager.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ISharpDevelopPackageRepositoryFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ISharpDevelopProjectManager.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ISharpDevelopProjectSystemFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ISolutionPackageRepository.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ISolutionPackageRepositoryFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ITask.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ITaskFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IThreadSafePackageManagementEvents.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IUpdatePackageActions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IUpdatePackagesAction.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\IUpdatePackageSettings.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\LicenseAcceptanceService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\LicenseAcceptanceViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MachinePackageCache.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ManagePackagesUserPrompts.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ManagePackagesViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ManagePackagesViewTitle.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MonoDevelopCredentialProvider.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MSBuildProjectExtensions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\NuGetExePath.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\NuGetPackageRestoreCommandLine.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageActionRunner.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageFromRepository.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageLicenseViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementEnumerableExtensions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementOptionsViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementSelectedProject.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementSelectedProjects.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementTask.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementTaskFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementViewModels.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageRepositoryFactoryEventArgs.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackagesForSelectedPageResult.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageSourceViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackagesViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackagesViewModels.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageViewModelFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageViewModelOperationLogger.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\Page.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\Pages.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ParentPackagesOperationEventArgs.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\Process.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\RecentPackagesViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ReducedPackageOperations.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\RegisteredPackageSourcesViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\RemovedPackageReferenceMonitor.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ResolveFileConflictEventArgs.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SelectedProjectsForInstalledPackages.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SelectedProjectsForUpdatedPackages.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SelectProjectsEventArgs.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SelectProjectsService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SelectProjectsViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MarkupString.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\OpenDotNetProjects.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageFiles.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageFilesForOperations.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementCompilerMessageView.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementEvents.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementFileService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementLogger.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementMessageViewCategory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementOptions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementOutputMessagesView.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementProject.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementProjectFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementProjectService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementPropertyService.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementServices.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementSolution.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageOperationExceptionEventArgs.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageOperationMessage.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageOperationMessageLoggedEventArgs.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageOperationsResolverFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageRepositoryCache.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageSourceConverter.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageSourceExtensions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ParentPackageOperationEventArgs.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ProcessPackageAction.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ProcessPackageOperationsAction.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ProjectBrowserUpdater.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ProjectExtensions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ProjectTargetFramework.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ProjectTemplatePackageRepositoryCache.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ProjectTemplatePackageSettingsFileName.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\RecentPackageInfo.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\RecentPackageRepository.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\RegisteredPackageRepositories.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\RegisteredPackageSource.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\RegisteredPackageSources.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\RegisteredPackageSourceSettings.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\RegisteredProjectTemplatePackageSources.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SettingsFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\MonoDevelopHttpUserAgent.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SharpDevelopPackageManager.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SharpDevelopPackageManagerFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SharpDevelopPackageRepositoryFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SharpDevelopProjectManager.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SharpDevelopProjectSystem.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SharpDevelopProjectSystemFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SolutionExtensions.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SolutionPackageRepository.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SolutionPackageRepositoryFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\SolutionPackageRepositoryPath.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ThreadSafePackageManagementEvents.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ThreadSafeProjectBrowserUpdater.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\UninstallPackageAction.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\UpdatedPackages.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\UpdatedPackagesViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\UpdatedPackageViewModel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\UpdatedPackageViewModelFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\UpdatePackageAction.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\UpdatePackagesAction.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\UpdatePackagesActionFactory.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\UpdateSolutionPackagesAction.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\UserAgentGeneratorForRepositoryRequests.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\ViewModelBase.cs" />
+ <Compile Include="gtk-gui\generated.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\ManagePackagesDialog.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.PackageManagement.ManagePackagesDialog.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\PackagesWidget.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.PackageManagement.PackagesWidget.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.PackageManagement.HyperlinkWidget.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\HyperlinkWidget.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\LicenseAcceptanceDialog.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\PackageLicenseWidget.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.PackageManagement.PackageLicenseWidget.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\SelectProjectsDialog.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.PackageManagement.SelectProjectsDialog.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\PackageSourcesOptionsPanel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\PackageSourcesWidget.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.PackageManagement.PackageSourcesWidget.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\PackageManagementOptionsPanel.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\PackageManagementOptionsWidget.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Gui\PagedResultsWidget.cs" />
+ <Compile Include="gtk-gui\MonoDevelop.PackageManagement.PagedResultsWidget.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="MonoDevelop.PackageManagement.addin.xml" />
+ <EmbeddedResource Include="gtk-gui\gui.stetic">
+ <LogicalName>gui.stetic</LogicalName>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="icons\packageicon.png">
+ <LogicalName>packageicon.png</LogicalName>
+ </EmbeddedResource>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
+ <Project>{7525BB88-6142-4A26-93B9-A30C6983390A}</Project>
+ <Name>MonoDevelop.Core</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\core\MonoDevelop.Ide\MonoDevelop.Ide.csproj">
+ <Project>{27096E7F-C91C-4AC6-B289-6897A701DF21}</Project>
+ <Name>MonoDevelop.Ide</Name>
+ <Private>False</Private>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\lib\NuGet.exe">
+ <Link>NuGet.exe</Link>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="..\lib\NuGet-LICENSE.txt">
+ <Link>NuGet-LICENSE.txt</Link>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+</Project>
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AcceptLicensesEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AcceptLicensesEventArgs.cs
new file mode 100644
index 0000000000..4f4eeeedde
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AcceptLicensesEventArgs.cs
@@ -0,0 +1,45 @@
+//
+// AcceptLicensesEventArgs.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class AcceptLicensesEventArgs : EventArgs
+ {
+ public AcceptLicensesEventArgs(IEnumerable<IPackage> packages)
+ {
+ this.Packages = packages;
+ }
+
+ public IEnumerable<IPackage> Packages { get; private set; }
+ public bool IsAccepted { get; set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AggregateExceptionErrorMessage.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AggregateExceptionErrorMessage.cs
new file mode 100644
index 0000000000..35248deea3
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AggregateExceptionErrorMessage.cs
@@ -0,0 +1,68 @@
+//
+// AggregateExceptionErrorMessage.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class AggregateExceptionErrorMessage
+ {
+ AggregateException ex;
+ StringBuilder errorMessage = new StringBuilder();
+
+ public AggregateExceptionErrorMessage(AggregateException ex)
+ {
+ this.ex = ex;
+ BuildErrorMessage();
+ }
+
+ void BuildErrorMessage()
+ {
+ BuildErrorMessage(ex.InnerExceptions);
+ }
+
+ void BuildErrorMessage(IEnumerable<Exception> exceptions)
+ {
+ foreach (Exception ex in exceptions) {
+ var aggregateEx = ex as AggregateException;
+ if (aggregateEx != null) {
+ BuildErrorMessage(aggregateEx.InnerExceptions);
+ } else {
+ errorMessage.AppendLine(ex.Message);
+ }
+ }
+ }
+
+ public override string ToString()
+ {
+ return errorMessage.ToString().TrimEnd();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AvailablePackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AvailablePackagesViewModel.cs
new file mode 100644
index 0000000000..7bb1e57874
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AvailablePackagesViewModel.cs
@@ -0,0 +1,92 @@
+//
+// AvailablePackagesViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class AvailablePackagesViewModel : PackagesViewModel
+ {
+ IPackageRepository repository;
+ string errorMessage;
+
+ public AvailablePackagesViewModel(
+ IRegisteredPackageRepositories registeredPackageRepositories,
+ IPackageViewModelFactory packageViewModelFactory,
+ ITaskFactory taskFactory)
+ : base(registeredPackageRepositories, packageViewModelFactory, taskFactory)
+ {
+ IsSearchable = true;
+ ShowPackageSources = true;
+ ShowPrerelease = true;
+ }
+
+ protected override void UpdateRepositoryBeforeReadPackagesTaskStarts()
+ {
+ try {
+ repository = RegisteredPackageRepositories.ActiveRepository;
+ } catch (Exception ex) {
+ errorMessage = ex.Message;
+ }
+ }
+
+ protected override IQueryable<IPackage> GetAllPackages()
+ {
+ if (repository == null) {
+ throw new ApplicationException(errorMessage);
+ }
+ if (IncludePrerelease) {
+ return repository.GetPackages();
+ }
+ return repository.GetPackages().Where(package => package.IsLatestVersion);
+ }
+
+ /// <summary>
+ /// Order packages by most downloaded first.
+ /// </summary>
+ protected override IQueryable<IPackage> OrderPackages(IQueryable<IPackage> packages)
+ {
+ return packages.OrderByDescending(package => package.DownloadCount);
+ }
+
+ protected override IEnumerable<IPackage> GetFilteredPackagesBeforePagingResults(IQueryable<IPackage> allPackages)
+ {
+ if (IncludePrerelease) {
+ return base.GetFilteredPackagesBeforePagingResults(allPackages)
+ .DistinctLast(PackageEqualityComparer.Id);
+ }
+ return base.GetFilteredPackagesBeforePagingResults(allPackages)
+ .Where(package => package.IsReleaseVersion())
+ .DistinctLast(PackageEqualityComparer.Id);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ConfigSettingsFileSystem.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ConfigSettingsFileSystem.cs
new file mode 100644
index 0000000000..0bbe79cc15
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ConfigSettingsFileSystem.cs
@@ -0,0 +1,49 @@
+//
+// ConfigSettingsFileSystem.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ConfigSettingsFileSystem : PhysicalFileSystem
+ {
+ ConfigSettingsFileSystem(string root)
+ : base(root)
+ {
+ }
+
+ public static ConfigSettingsFileSystem CreateConfigSettingsFileSystem(Solution solution)
+ {
+ string configSettingsFolder = Path.Combine(solution.BaseDirectory, ".nuget");
+ return new ConfigSettingsFileSystem(configSettingsFolder);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DefaultProjectTemplatePackageSource.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DefaultProjectTemplatePackageSource.cs
new file mode 100644
index 0000000000..bb3180a475
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DefaultProjectTemplatePackageSource.cs
@@ -0,0 +1,58 @@
+//
+// DefaultProjectTemplatePackageSource.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.IO;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class DefaultProjectTemplatePackageSource
+ {
+ PackageSource packageSource;
+
+ public DefaultProjectTemplatePackageSource()
+ : this(new PackageManagementPropertyService())
+ {
+ }
+
+ public DefaultProjectTemplatePackageSource(IPropertyService propertyService)
+ {
+ CreatePackageSource(propertyService.DataDirectory);
+ }
+
+ void CreatePackageSource(string dataDirectory)
+ {
+ string packageDirectory = Path.Combine(dataDirectory, @"templates\packages");
+ packageSource = new PackageSource(packageDirectory, "Default");
+ }
+
+ public PackageSource PackageSource {
+ get { return packageSource; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DelegateCommand.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DelegateCommand.cs
new file mode 100644
index 0000000000..fa114d2128
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DelegateCommand.cs
@@ -0,0 +1,67 @@
+//
+// DelegateCommand.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class DelegateCommand : ICommand
+ {
+ Action<object> execute;
+ Predicate<object> canExecute;
+
+ public DelegateCommand(Action<object> execute, Predicate<object> canExecute)
+ {
+ this.execute = execute;
+ this.canExecute = canExecute;
+ }
+
+ public DelegateCommand(Action<object> execute)
+ : this(execute, null)
+ {
+ }
+
+ public event EventHandler CanExecuteChanged {
+ add { } //CommandManager.RequerySuggested += value; }
+ remove { } //CommandManager.RequerySuggested -= value; }
+ }
+
+ public void Execute(object parameter)
+ {
+ execute(parameter);
+ }
+
+ public bool CanExecute(object parameter)
+ {
+ if (canExecute != null) {
+ return canExecute(parameter);
+ }
+ return true;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectExtensions.cs
new file mode 100644
index 0000000000..a6baeb3682
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DotNetProjectExtensions.cs
@@ -0,0 +1,112 @@
+//
+// DotNetProjectExtensions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Projects;
+using MonoDevelop.Projects.Formats.MSBuild;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class DotNetProjectExtensions
+ {
+ public static readonly Guid WebApplication = Guid.Parse("{349C5851-65DF-11DA-9384-00065B846F21}");
+ public static readonly Guid WebSite = Guid.Parse("{E24C65DC-7377-472B-9ABA-BC803B73C61A}");
+
+ public static bool IsWebProject(this DotNetProject project)
+ {
+ return project.HasProjectType(WebApplication) || project.HasProjectType(WebSite);
+ }
+
+ public static string GetEvaluatedProperty(this DotNetProject project, string name)
+ {
+ if ("RootNamespace".Equals(name, StringComparison.OrdinalIgnoreCase)) {
+ return project.DefaultNamespace;
+ }
+ return String.Empty;
+ }
+
+ public static bool HasProjectType(this DotNetProject project, Guid projectTypeGuid)
+ {
+ foreach (string guid in project.GetProjectTypeGuids()) {
+ if (IsMatch(projectTypeGuid, guid)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static string[] GetProjectTypeGuids(this DotNetProject project)
+ {
+ string projectTypeGuids = project.GetProjectTypeGuidPropertyValue();
+ return projectTypeGuids.Split(new char[] {';'}, StringSplitOptions.RemoveEmptyEntries);
+ }
+
+ static bool IsMatch(Guid guid, string guidStringToMatch)
+ {
+ Guid result;
+ if (Guid.TryParse(guidStringToMatch, out result)) {
+ return guid == result;
+ }
+ return false;
+ }
+
+ public static string GetProjectTypeGuidPropertyValue(this DotNetProject project)
+ {
+ string propertyValue = null;
+ if (project.ExtendedProperties.Contains("ProjectTypeGuids")) {
+ propertyValue = project.ExtendedProperties["ProjectTypeGuids"] as String;
+ }
+ return propertyValue ?? String.Empty;
+ }
+
+ public static void AddImportIfMissing(
+ this DotNetProject project,
+ string importedProjectFile,
+ ProjectImportLocation importLocation)
+ {
+ var msbuildProject = new MSBuildProject ();
+ msbuildProject.Load (project.FileName);
+ msbuildProject.AddImportIfMissing (importedProjectFile, importLocation, GetCondition (importedProjectFile));
+ msbuildProject.Save (project.FileName);
+ }
+
+ static string GetCondition(string importedProjectFile)
+ {
+ return String.Format("Exists('{0}')", importedProjectFile);
+ }
+
+ public static void RemoveImport(this DotNetProject project, string importedProjectFile)
+ {
+ var msbuildProject = new MSBuildProject ();
+ msbuildProject.Load (project.FileName);
+ msbuildProject.RemoveImportIfExists (importedProjectFile);
+ msbuildProject.Save (project.FileName);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs
new file mode 100644
index 0000000000..613274d54c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FileConflictResolver.cs
@@ -0,0 +1,75 @@
+//
+// FileConflictResolver.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Ide;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class FileConflictResolver : IFileConflictResolver
+ {
+ static AlertButton YesToAllButton = new AlertButton ("Yes to All");
+ static AlertButton NoToAllButton = new AlertButton ("No to All");
+
+ AlertButton[] buttons = new AlertButton[] {
+ AlertButton.Yes,
+ YesToAllButton,
+ AlertButton.No,
+ NoToAllButton
+ };
+
+ const int YesButtonIndex = 0;
+ const int YesToAllButtonIndex = 1;
+ const int NoButtonIndex = 2;
+ const int NoToAllButtonIndex = 3;
+
+ public FileConflictResolution ResolveFileConflict(string message)
+ {
+ AlertButton result = MessageService.AskQuestion(
+ "File Conflict",
+ message,
+ NoButtonIndex, // "No" is default accept button.
+ buttons);
+ return MapResultToFileConflictResolution(result);
+ }
+
+ FileConflictResolution MapResultToFileConflictResolution(AlertButton result)
+ {
+ if (result == AlertButton.Yes) {
+ return FileConflictResolution.Overwrite;
+ } else if (result == YesToAllButton) {
+ return FileConflictResolution.OverwriteAll;
+ } else if (result == NoToAllButton) {
+ return FileConflictResolution.IgnoreAll;
+ } else {
+ return FileConflictResolution.Ignore;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FolderBrowser.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FolderBrowser.cs
new file mode 100644
index 0000000000..93bc7421ea
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FolderBrowser.cs
@@ -0,0 +1,45 @@
+//
+// FolderBrowser.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Components;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class FolderBrowser : IFolderBrowser
+ {
+ public string SelectFolder ()
+ {
+ var dialog = new SelectFolderDialog ();
+ if (dialog.Run ()) {
+ return dialog.SelectedFile;
+ }
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICommand.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICommand.cs
new file mode 100644
index 0000000000..13ad4de0f5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICommand.cs
@@ -0,0 +1,40 @@
+//
+// ICommand.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ICommand
+ {
+ bool CanExecute(object parameter);
+ void Execute(object parameter);
+
+ event EventHandler CanExecuteChanged;
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICompilerMessageView.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICompilerMessageView.cs
new file mode 100644
index 0000000000..dc57f7fefe
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICompilerMessageView.cs
@@ -0,0 +1,39 @@
+//
+// ICompilerMessageView.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ICompilerMessageView
+ {
+ IMessageViewCategory Create(string categoryName, string categoryDisplayName);
+
+ IMessageViewCategory GetExisting(string name);
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFolderBrowser.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFolderBrowser.cs
new file mode 100644
index 0000000000..ee2625484e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFolderBrowser.cs
@@ -0,0 +1,37 @@
+//
+// IFolderBrowser.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IFolderBrowser
+ {
+ string SelectFolder();
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ILicenseAcceptanceService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ILicenseAcceptanceService.cs
new file mode 100644
index 0000000000..b31c251516
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ILicenseAcceptanceService.cs
@@ -0,0 +1,39 @@
+//
+// ILicenseAcceptanceService.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ILicenseAcceptanceService
+ {
+ bool AcceptLicenses(IEnumerable<IPackage> packages);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMachinePackageCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMachinePackageCache.cs
new file mode 100644
index 0000000000..3965ddb4a6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMachinePackageCache.cs
@@ -0,0 +1,41 @@
+//
+// IMachinePackageCache.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IMachinePackageCache
+ {
+ IQueryable<IPackage> GetPackages();
+ void Clear();
+ string Source { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMessageViewCategory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMessageViewCategory.cs
new file mode 100644
index 0000000000..6faad20cc1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMessageViewCategory.cs
@@ -0,0 +1,38 @@
+//
+// IMessageViewCategory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IMessageViewCategory
+ {
+ void AppendLine(string text);
+ void Clear();
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageAction.cs
new file mode 100644
index 0000000000..1e544319d4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageAction.cs
@@ -0,0 +1,39 @@
+//
+// IPackageAction.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageAction
+ {
+ void Execute();
+ bool HasPackageScriptsToRun();
+ //IPackageScriptRunner PackageScriptRunner { get; set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageActionRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageActionRunner.cs
new file mode 100644
index 0000000000..a90f8977d3
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageActionRunner.cs
@@ -0,0 +1,39 @@
+//
+// IPackageActionRunner.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageActionRunner
+ {
+ void Run(IPackageAction action);
+ void Run(IEnumerable<IPackageAction> actions);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageExtensions.cs
new file mode 100644
index 0000000000..0ba7363c9d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageExtensions.cs
@@ -0,0 +1,56 @@
+//
+// IPackageExtensions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class IPackageExtensions
+ {
+ /// <summary>
+ /// Returns description if summary is missing.
+ /// </summary>
+ public static string SummaryOrDescription(this IPackage package)
+ {
+ if (String.IsNullOrEmpty(package.Summary))
+ return package.Description;
+ return package.Summary;
+ }
+
+ /// <summary>
+ /// Returns package Id if it has no title.
+ /// </summary>
+ public static string GetName(this IPackage package)
+ {
+ if (String.IsNullOrEmpty(package.Title))
+ return package.Id;
+ return package.Title;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepository.cs
new file mode 100644
index 0000000000..4e3b61a589
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepository.cs
@@ -0,0 +1,41 @@
+//
+// IPackageFromRepository.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageFromRepository : IPackage
+ {
+ IPackageRepository Repository { get; }
+ bool HasDependencies { get; }
+ DateTime? LastUpdated { get; }
+ Uri GalleryUrl { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepositoryExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepositoryExtensions.cs
new file mode 100644
index 0000000000..8ddae3f231
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepositoryExtensions.cs
@@ -0,0 +1,54 @@
+//
+// IPackageFromRepositoryExtensions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class IPackageFromRepositoryExtensions
+ {
+ public static IDisposable StartInstallOperation(this IPackageFromRepository package)
+ {
+ return package.Repository.StartInstallOperation(package.Id, GetVersion(package.Version));
+ }
+
+ public static IDisposable StartUpdateOperation(this IPackageFromRepository package)
+ {
+ return package.Repository.StartUpdateOperation(package.Id, GetVersion(package.Version));
+ }
+
+ static string GetVersion(SemanticVersion version)
+ {
+ if (version != null) {
+ return version.ToString();
+ }
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementEvents.cs
new file mode 100644
index 0000000000..52ab692a58
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementEvents.cs
@@ -0,0 +1,57 @@
+//
+// IPackageManagementEvents.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageManagementEvents
+ {
+ event EventHandler PackageOperationsStarting;
+ event EventHandler<AcceptLicensesEventArgs> AcceptLicenses;
+ event EventHandler<SelectProjectsEventArgs> SelectProjects;
+ event EventHandler<ResolveFileConflictEventArgs> ResolveFileConflict;
+ event EventHandler<PackageOperationExceptionEventArgs> PackageOperationError;
+ event EventHandler<ParentPackageOperationEventArgs> ParentPackageInstalled;
+ event EventHandler<ParentPackageOperationEventArgs> ParentPackageUninstalled;
+ event EventHandler<ParentPackagesOperationEventArgs> ParentPackagesUpdated;
+ event EventHandler<PackageOperationMessageLoggedEventArgs> PackageOperationMessageLogged;
+
+ void OnPackageOperationsStarting();
+ void OnPackageOperationError(Exception ex);
+ bool OnAcceptLicenses(IEnumerable<IPackage> packages);
+ void OnParentPackageInstalled(IPackage package);
+ void OnParentPackageUninstalled(IPackage package);
+ void OnParentPackagesUpdated(IEnumerable<IPackage> packages);
+ void OnPackageOperationMessageLogged(MessageLevel level, string message, params object[] args);
+ bool OnSelectProjects(IEnumerable<IPackageManagementSelectedProject> selectedProjects);
+ FileConflictResolution OnResolveFileConflict(string message);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementFileService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementFileService.cs
new file mode 100644
index 0000000000..fdc1a9604b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementFileService.cs
@@ -0,0 +1,38 @@
+//
+// IPackageManagementFileService.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageManagementFileService
+ {
+ void RemoveFile(string path);
+ void RemoveDirectory(string path);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementOutputMessagesView.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementOutputMessagesView.cs
new file mode 100644
index 0000000000..89dd3c1719
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementOutputMessagesView.cs
@@ -0,0 +1,37 @@
+//
+// IPackageManagementOutputMessagesView.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageManagementOutputMessagesView
+ {
+ void Clear();
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProject.cs
new file mode 100644
index 0000000000..f5f5894c49
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProject.cs
@@ -0,0 +1,72 @@
+//
+// IPackageManagementProject.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageManagementProject
+ {
+ event EventHandler<PackageOperationEventArgs> PackageInstalled;
+ event EventHandler<PackageOperationEventArgs> PackageUninstalled;
+ event EventHandler<PackageOperationEventArgs> PackageReferenceAdded;
+ event EventHandler<PackageOperationEventArgs> PackageReferenceRemoved;
+
+ string Name { get; }
+ ILogger Logger { get; set; }
+ IPackageRepository SourceRepository { get; }
+
+ bool IsPackageInstalled(IPackage package);
+ bool IsPackageInstalled(string packageId);
+ bool HasOlderPackageInstalled(IPackage package);
+
+ IQueryable<IPackage> GetPackages();
+ IEnumerable<IPackage> GetPackagesInReverseDependencyOrder();
+
+ IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction);
+ IEnumerable<PackageOperation> GetUpdatePackagesOperations(IEnumerable<IPackage> packages, IUpdatePackageSettings settings);
+
+ void InstallPackage(IPackage package, InstallPackageAction installAction);
+ void UpdatePackage(IPackage package, UpdatePackageAction updateAction);
+ void UninstallPackage(IPackage package, UninstallPackageAction uninstallAction);
+ void UpdatePackages(UpdatePackagesAction action);
+
+ void UpdatePackageReference(IPackage package, IUpdatePackageSettings settings);
+
+ InstallPackageAction CreateInstallPackageAction();
+ UninstallPackageAction CreateUninstallPackageAction();
+ UpdatePackageAction CreateUpdatePackageAction();
+ UpdatePackagesAction CreateUpdatePackagesAction();
+
+ void RunPackageOperations(IEnumerable<PackageOperation> expectedOperations);
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectFactory.cs
new file mode 100644
index 0000000000..5a92539b45
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectFactory.cs
@@ -0,0 +1,38 @@
+//
+// IPackageManagementProjectFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageManagementProjectFactory
+ {
+ IPackageManagementProject CreateProject(IPackageRepository sourceRepository, DotNetProject project);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectService.cs
new file mode 100644
index 0000000000..d4d161bc72
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectService.cs
@@ -0,0 +1,49 @@
+//
+// IPackageManagementProjectService.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Projects;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageManagementProjectService
+ {
+ Project CurrentProject { get; }
+ Solution OpenSolution { get; }
+
+ void Save(Project project);
+ void Save(Solution solution);
+
+ IEnumerable<Project> GetOpenProjects();
+
+ IProjectBrowserUpdater CreateProjectBrowserUpdater();
+
+ string GetDefaultCustomToolForFileName(ProjectFile projectItem);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSelectedProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSelectedProject.cs
new file mode 100644
index 0000000000..e7089d2caf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSelectedProject.cs
@@ -0,0 +1,43 @@
+//
+// IPackageManagementSelectedProject.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageManagementSelectedProject
+ {
+ string Name { get; }
+ bool IsSelected { get; set; }
+ bool IsEnabled { get; set; }
+
+ IPackageManagementProject Project { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSolution.cs
new file mode 100644
index 0000000000..acb993f73f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSolution.cs
@@ -0,0 +1,59 @@
+//
+// IPackageManagementSolution.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageManagementSolution
+ {
+ IPackageManagementProject GetActiveProject();
+ IPackageManagementProject GetActiveProject(IPackageRepository sourceRepository);
+ IPackageManagementProject GetProject(PackageSource source, string projectName);
+ IPackageManagementProject GetProject(IPackageRepository sourceRepository, string projectName);
+ IPackageManagementProject GetProject(IPackageRepository sourceRepository, Project project);
+ IEnumerable<IPackageManagementProject> GetProjects(IPackageRepository sourceRepository);
+
+ Project GetActiveDotNetProject();
+ IEnumerable<Project> GetDotNetProjects();
+ bool HasMultipleProjects();
+
+ bool IsPackageInstalled(IPackage package);
+ IQueryable<IPackage> GetPackages();
+ IEnumerable<IPackage> GetPackagesInReverseDependencyOrder();
+ string GetInstallPath(IPackage package);
+
+ bool IsOpen { get; }
+ string FileName { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagerFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagerFactory.cs
new file mode 100644
index 0000000000..ec4285d316
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagerFactory.cs
@@ -0,0 +1,41 @@
+//
+// IPackageManagerFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageManagerFactory
+ {
+ ISharpDevelopPackageManager CreatePackageManager(
+ IPackageRepository sourceRepository,
+ DotNetProject project);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageOperationResolverFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageOperationResolverFactory.cs
new file mode 100644
index 0000000000..e4e6f2fe27
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageOperationResolverFactory.cs
@@ -0,0 +1,48 @@
+//
+// IPackageOperationResolverFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageOperationResolverFactory
+ {
+ IPackageOperationResolver CreateInstallPackageOperationResolver(
+ IPackageRepository localRepository,
+ IPackageRepository sourceRepository,
+ ILogger logger,
+ InstallPackageAction installAction);
+
+ IPackageOperationResolver CreateUpdatePackageOperationResolver(
+ IPackageRepository localRepository,
+ IPackageRepository sourceRepository,
+ ILogger logger,
+ IUpdatePackageSettings settings);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryCache.cs
new file mode 100644
index 0000000000..5384a70332
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryCache.cs
@@ -0,0 +1,39 @@
+//
+// IPackageRepositoryCache.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageRepositoryCache : ISharpDevelopPackageRepositoryFactory
+ {
+ IRecentPackageRepository RecentPackageRepository { get; }
+ IPackageRepository CreateAggregateRepository();
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryExtensions.cs
new file mode 100644
index 0000000000..8a498fee44
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryExtensions.cs
@@ -0,0 +1,46 @@
+//
+// IPackageRepositoryExtensions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class IPackageRepositoryExtensions
+ {
+ public static IDisposable StartInstallOperation(this IPackageRepository repository, string mainPackageId = null, string mainPackageVersion = null)
+ {
+ return repository.StartOperation(RepositoryOperationNames.Install, mainPackageId, mainPackageVersion);
+ }
+
+ public static IDisposable StartUpdateOperation(this IPackageRepository repository, string mainPackageId = null, string mainPackageVersion = null)
+ {
+ return repository.StartOperation(RepositoryOperationNames.Update, mainPackageId, mainPackageVersion);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryFactoryEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryFactoryEvents.cs
new file mode 100644
index 0000000000..a59e910baf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryFactoryEvents.cs
@@ -0,0 +1,37 @@
+//
+// IPackageRepositoryFactoryEvents.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageRepositoryFactoryEvents
+ {
+ event EventHandler<PackageRepositoryFactoryEventArgs> RepositoryCreated;
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelFactory.cs
new file mode 100644
index 0000000000..9c6e84e042
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelFactory.cs
@@ -0,0 +1,44 @@
+//
+// IPackageViewModelFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageViewModelFactory
+ {
+ PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package);
+
+ IPackageManagementSolution Solution { get; }
+ PackageManagementSelectedProjects SelectedProjects { get; }
+ IPackageManagementEvents PackageManagementEvents { get; }
+ IPackageActionRunner PackageActionRunner { get; }
+ ILogger Logger { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelParent.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelParent.cs
new file mode 100644
index 0000000000..0f9a0cf82c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelParent.cs
@@ -0,0 +1,37 @@
+//
+// IPackageFromRepository.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPackageViewModelParent
+ {
+ bool IncludePrerelease { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProcess.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProcess.cs
new file mode 100644
index 0000000000..d67b526c9c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProcess.cs
@@ -0,0 +1,37 @@
+//
+// IProcess.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IProcess
+ {
+ void Start(string fileName);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProjectBrowserUpdater.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProjectBrowserUpdater.cs
new file mode 100644
index 0000000000..4bffc15d8d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProjectBrowserUpdater.cs
@@ -0,0 +1,36 @@
+//
+// IProjectBrowserUpdater.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IProjectBrowserUpdater : IDisposable
+ {
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPropertyService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPropertyService.cs
new file mode 100644
index 0000000000..664fe023d6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPropertyService.cs
@@ -0,0 +1,38 @@
+//
+// IPropertyService.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IPropertyService
+ {
+ string DataDirectory { get; }
+ string ConfigDirectory { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRecentPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRecentPackageRepository.cs
new file mode 100644
index 0000000000..c9b4b03a72
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRecentPackageRepository.cs
@@ -0,0 +1,39 @@
+//
+// IRecentPackageRepository.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IRecentPackageRepository : IPackageRepository
+ {
+ void Clear();
+ bool HasRecentPackages { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRegisteredPackageRepositories.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRegisteredPackageRepositories.cs
new file mode 100644
index 0000000000..98ee881282
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRegisteredPackageRepositories.cs
@@ -0,0 +1,46 @@
+//
+// IRegisteredPackageRepositories.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IRegisteredPackageRepositories
+ {
+ IPackageRepository ActiveRepository { get; }
+ IRecentPackageRepository RecentPackageRepository { get; }
+
+ IPackageRepository CreateRepository(PackageSource source);
+ IPackageRepository CreateAggregateRepository();
+
+ bool HasMultiplePackageSources { get; }
+ PackageSource ActivePackageSource { get; set; }
+ RegisteredPackageSources PackageSources { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISelectProjectsService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISelectProjectsService.cs
new file mode 100644
index 0000000000..8a79ad0a66
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISelectProjectsService.cs
@@ -0,0 +1,38 @@
+//
+// ISelectProjectsService.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ISelectProjectsService
+ {
+ bool SelectProjects(IEnumerable<IPackageManagementSelectedProject> projects);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsFactory.cs
new file mode 100644
index 0000000000..4199af4034
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsFactory.cs
@@ -0,0 +1,38 @@
+//
+// ISettingsFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ISettingsFactory
+ {
+ ISettings CreateSettings(string directory);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageManager.cs
new file mode 100644
index 0000000000..ef98bc654e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageManager.cs
@@ -0,0 +1,50 @@
+//
+// ISharpDevelopPackageManager.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ISharpDevelopPackageManager : IPackageManager
+ {
+ ISharpDevelopProjectManager ProjectManager { get; }
+
+ void InstallPackage(IPackage package, InstallPackageAction installAction);
+ void UninstallPackage(IPackage package, UninstallPackageAction uninstallAction);
+ void UpdatePackage(IPackage package, UpdatePackageAction updateAction);
+ void UpdatePackages(UpdatePackagesAction updateAction);
+ void UpdatePackageReference(IPackage package, IUpdatePackageSettings settings);
+
+ IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction);
+ IEnumerable<PackageOperation> GetUpdatePackageOperations(IEnumerable<IPackage> packages, IUpdatePackageSettings settings);
+
+ void RunPackageOperations(IEnumerable<PackageOperation> operations);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageRepositoryFactory.cs
new file mode 100644
index 0000000000..f4f0b8ad96
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageRepositoryFactory.cs
@@ -0,0 +1,48 @@
+//
+// ISharpDevelopPackageRepositoryFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ISharpDevelopPackageRepositoryFactory : IPackageRepositoryFactory
+ {
+ ISharedPackageRepository CreateSharedRepository(
+ IPackagePathResolver pathResolver,
+ IFileSystem fileSystem,
+ IFileSystem configSettingsFileSystem);
+
+ IRecentPackageRepository CreateRecentPackageRepository(
+ IList<RecentPackageInfo> recentPackages,
+ IPackageRepository aggregateRepository);
+
+ IPackageRepository CreateAggregateRepository(IEnumerable<IPackageRepository> repositories);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectManager.cs
new file mode 100644
index 0000000000..2a5361f394
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectManager.cs
@@ -0,0 +1,40 @@
+//
+// ISharpDevelopProjectManager.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ISharpDevelopProjectManager : IProjectManager
+ {
+ IPackagePathResolver PathResolver { get; }
+ bool IsInstalled(string packageId);
+ bool HasOlderPackageInstalled(IPackage package);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectSystemFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectSystemFactory.cs
new file mode 100644
index 0000000000..a9bd683b0b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectSystemFactory.cs
@@ -0,0 +1,39 @@
+//
+// ISharpDevelopProjectSystemFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ISharpDevelopProjectSystemFactory
+ {
+ IProjectSystem CreateProjectSystem(DotNetProject project);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepository.cs
new file mode 100644
index 0000000000..e73cd209f5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepository.cs
@@ -0,0 +1,49 @@
+//
+// ISolutionPackageRepository.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ISolutionPackageRepository
+ {
+ string GetInstallPath(IPackage package);
+ IEnumerable<IPackage> GetPackagesByDependencyOrder();
+ IEnumerable<IPackage> GetPackagesByReverseDependencyOrder();
+ IQueryable<IPackage> GetPackages();
+ bool IsInstalled(IPackage package);
+
+ ISharedPackageRepository Repository { get; }
+ IFileSystem FileSystem { get; }
+ IPackagePathResolver PackagePathResolver { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepositoryFactory.cs
new file mode 100644
index 0000000000..c3ab8c2652
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepositoryFactory.cs
@@ -0,0 +1,38 @@
+//
+// ISolutionPackageRepositoryFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Projects;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ISolutionPackageRepositoryFactory
+ {
+ ISolutionPackageRepository CreateSolutionPackageRepository(Solution solution);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITask.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITask.cs
new file mode 100644
index 0000000000..ff7af23c3a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITask.cs
@@ -0,0 +1,44 @@
+//
+// ITask.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ITask<TResult>
+ {
+ void Start();
+ void Cancel();
+
+ TResult Result { get; }
+
+ bool IsCancelled { get; }
+ bool IsFaulted { get; }
+ AggregateException Exception { get; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITaskFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITaskFactory.cs
new file mode 100644
index 0000000000..92e04d0dd9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITaskFactory.cs
@@ -0,0 +1,39 @@
+//
+// ITaskFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface ITaskFactory
+ {
+ ITask<TResult> CreateTask<TResult>(
+ Func<TResult> function,
+ Action<ITask<TResult>> continueWith);
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IThreadSafePackageManagementEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IThreadSafePackageManagementEvents.cs
new file mode 100644
index 0000000000..26abff3221
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IThreadSafePackageManagementEvents.cs
@@ -0,0 +1,36 @@
+//
+// IThreadSafePackageManagementEvents.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IThreadSafePackageManagementEvents : IPackageManagementEvents, IDisposable
+ {
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageActions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageActions.cs
new file mode 100644
index 0000000000..b02670416b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageActions.cs
@@ -0,0 +1,40 @@
+//
+// IUpdatePackageActions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IUpdatePackageActions : IUpdatePackageSettings
+ {
+ //IPackageScriptRunner PackageScriptRunner { get; set; }
+
+ IEnumerable<UpdatePackageAction> CreateActions();
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageSettings.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageSettings.cs
new file mode 100644
index 0000000000..fe56a04af8
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageSettings.cs
@@ -0,0 +1,38 @@
+//
+// IUpdatePackageSettings.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IUpdatePackageSettings
+ {
+ bool UpdateDependencies { get; set; }
+ bool AllowPrereleaseVersions { get; set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackagesAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackagesAction.cs
new file mode 100644
index 0000000000..b78ee7506b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackagesAction.cs
@@ -0,0 +1,43 @@
+//
+// IUpdatePackagesAction.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public interface IUpdatePackagesAction : IPackageAction, IUpdatePackageSettings
+ {
+ IEnumerable<PackageOperation> Operations { get; }
+ ILogger Logger { get; set; }
+
+ void AddPackages(IEnumerable<IPackageFromRepository> packages);
+ void AddOperations(IEnumerable<PackageOperation> operations);
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs
new file mode 100644
index 0000000000..f7aa75de1a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs
@@ -0,0 +1,58 @@
+//
+// InstallPackageAction.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class InstallPackageAction : ProcessPackageOperationsAction
+ {
+ public InstallPackageAction(
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents)
+ : base(project, packageManagementEvents)
+ {
+ }
+
+ public bool IgnoreDependencies { get; set; }
+
+ protected override IEnumerable<PackageOperation> GetPackageOperations()
+ {
+ return Project.GetInstallPackageOperations(Package, this);
+ }
+
+ protected override void ExecuteCore()
+ {
+ Project.InstallPackage(Package, this);
+ OnParentPackageInstalled();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModel.cs
new file mode 100644
index 0000000000..42e8a84343
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModel.cs
@@ -0,0 +1,89 @@
+//
+// InstalledPackageViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class InstalledPackageViewModel : PackageViewModel
+ {
+ public InstalledPackageViewModel(
+ IPackageViewModelParent parent,
+ IPackageFromRepository package,
+ SelectedProjectsForInstalledPackages selectedProjects,
+ IPackageManagementEvents packageManagementEvents,
+ IPackageActionRunner actionRunner,
+ ILogger logger)
+ : base(parent, package, selectedProjects, packageManagementEvents, actionRunner, logger)
+ {
+ }
+
+ public override IList<ProcessPackageAction> GetProcessPackageActionsForSelectedProjects(
+ IList<IPackageManagementSelectedProject> selectedProjects)
+ {
+ var actions = new List<ProcessPackageAction>();
+ foreach (IPackageManagementSelectedProject selectedProject in selectedProjects) {
+ ProcessPackageAction action = CreatePackageAction(selectedProject);
+ if (action != null) {
+ actions.Add(action);
+ }
+ }
+ return actions;
+ }
+
+ ProcessPackageAction CreatePackageAction(IPackageManagementSelectedProject selectedProject)
+ {
+ if (selectedProject.IsSelected) {
+ return base.CreateInstallPackageAction(selectedProject);
+ }
+ return CreateUninstallPackageActionForSelectedProject(selectedProject);
+ }
+
+ ProcessPackageAction CreateUninstallPackageActionForSelectedProject(IPackageManagementSelectedProject selectedProject)
+ {
+ ProcessPackageAction action = base.CreateUninstallPackageAction(selectedProject);
+ if (IsPackageInstalled(action.Project)) {
+ return action;
+ }
+ return null;
+ }
+
+ bool IsPackageInstalled(IPackageManagementProject project)
+ {
+ IPackage package = GetPackage();
+ return project.IsPackageInstalled(package);
+ }
+
+ protected override bool AnyProjectsSelected(IList<IPackageManagementSelectedProject> projects)
+ {
+ return true;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModelFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModelFactory.cs
new file mode 100644
index 0000000000..ea31b50e6d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModelFactory.cs
@@ -0,0 +1,54 @@
+//
+// InstalledPackageViewModelFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class InstalledPackageViewModelFactory : PackageViewModelFactory
+ {
+ SelectedProjectsForInstalledPackages selectedProjectsForInstalledPackages;
+
+ public InstalledPackageViewModelFactory(IPackageViewModelFactory packageViewModelFactory)
+ : base(packageViewModelFactory)
+ {
+ selectedProjectsForInstalledPackages = new SelectedProjectsForInstalledPackages(Solution);
+ }
+
+ public override PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
+ {
+ return new InstalledPackageViewModel(
+ parent,
+ package,
+ selectedProjectsForInstalledPackages,
+ PackageManagementEvents,
+ PackageActionRunner,
+ Logger);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackagesViewModel.cs
new file mode 100644
index 0000000000..97277f10fa
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackagesViewModel.cs
@@ -0,0 +1,102 @@
+//
+// InstalledPackagesViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class InstalledPackagesViewModel : PackagesViewModel
+ {
+ IPackageManagementSolution solution;
+ IPackageManagementEvents packageManagementEvents;
+ IPackageManagementProject project;
+ string errorMessage;
+
+ public InstalledPackagesViewModel(
+ IPackageManagementSolution solution,
+ IPackageManagementEvents packageManagementEvents,
+ IRegisteredPackageRepositories registeredPackageRepositories,
+ InstalledPackageViewModelFactory packageViewModelFactory,
+ ITaskFactory taskFactory)
+ : base(registeredPackageRepositories, packageViewModelFactory, taskFactory)
+ {
+ this.solution = solution;
+ this.packageManagementEvents = packageManagementEvents;
+
+ RegisterEvents();
+ TryGetActiveProject();
+ }
+
+ void RegisterEvents()
+ {
+ packageManagementEvents.ParentPackageInstalled += InstalledPackagesChanged;
+ packageManagementEvents.ParentPackageUninstalled += InstalledPackagesChanged;
+ packageManagementEvents.ParentPackagesUpdated += InstalledPackagesChanged;
+ }
+
+ void TryGetActiveProject()
+ {
+ try {
+ project = solution.GetActiveProject();
+ } catch (Exception ex) {
+ errorMessage = ex.Message;
+ }
+ }
+
+ void InstalledPackagesChanged(object sender, EventArgs e)
+ {
+ ReadPackages();
+ }
+
+ protected override void OnDispose()
+ {
+ packageManagementEvents.ParentPackageInstalled -= InstalledPackagesChanged;
+ packageManagementEvents.ParentPackageUninstalled -= InstalledPackagesChanged;
+ packageManagementEvents.ParentPackagesUpdated -= InstalledPackagesChanged;
+ }
+
+ protected override IQueryable<IPackage> GetAllPackages()
+ {
+ if (errorMessage != null) {
+ ThrowOriginalExceptionWhenTryingToGetProjectManager();
+ }
+ if (project != null) {
+ return project.GetPackages();
+ }
+ return solution.GetPackages();
+ }
+
+ void ThrowOriginalExceptionWhenTryingToGetProjectManager()
+ {
+ throw new ApplicationException(errorMessage);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs
new file mode 100644
index 0000000000..443d95799c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs
@@ -0,0 +1,52 @@
+//
+// LicenseAcceptanceService.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Ide;
+using MonoDevelop.PackageManagement;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class LicenseAcceptanceService : ILicenseAcceptanceService
+ {
+ public bool AcceptLicenses(IEnumerable<IPackage> packages)
+ {
+ LicenseAcceptanceDialog dialog = CreateLicenseAcceptanceDialog(packages);
+ int result = MessageService.ShowCustomDialog(dialog);
+ return result == (int)Gtk.ResponseType.Ok;
+ }
+
+ LicenseAcceptanceDialog CreateLicenseAcceptanceDialog(IEnumerable<IPackage> packages)
+ {
+ var viewModel = new LicenseAcceptanceViewModel(packages);
+ return new LicenseAcceptanceDialog(viewModel);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceViewModel.cs
new file mode 100644
index 0000000000..2b3d123122
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceViewModel.cs
@@ -0,0 +1,59 @@
+//
+// LicenseAcceptanceViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class LicenseAcceptanceViewModel : ViewModelBase<LicenseAcceptanceViewModel>
+ {
+ IList<PackageLicenseViewModel> packages;
+
+ public LicenseAcceptanceViewModel(IEnumerable<IPackage> packages)
+ {
+ this.packages = packages
+ .Select(p => new PackageLicenseViewModel(p))
+ .ToList();
+ }
+
+ public IEnumerable<PackageLicenseViewModel> Packages {
+ get { return packages; }
+ }
+
+ public bool HasOnePackage {
+ get { return packages.Count == 1; }
+ }
+
+ public bool HasMultiplePackages {
+ get { return packages.Count > 1; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildProjectExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildProjectExtensions.cs
new file mode 100644
index 0000000000..b474eacc33
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MSBuildProjectExtensions.cs
@@ -0,0 +1,126 @@
+//
+// MSBuildProjectExtensions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml;
+
+using MonoDevelop.Projects.Formats.MSBuild;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class MSBuildProjectExtensions
+ {
+ static readonly XmlNamespaceManager namespaceManager =
+ new XmlNamespaceManager (new NameTable ());
+
+ static MSBuildProjectExtensions ()
+ {
+ namespaceManager.AddNamespace ("tns", MSBuildProject.Schema);
+ }
+
+ public static void AddImportIfMissing (
+ this MSBuildProject project,
+ string importedProjectFile,
+ ProjectImportLocation importLocation,
+ string condition)
+ {
+ if (project.ImportExists (importedProjectFile))
+ return;
+
+ project.AddImport (importedProjectFile, importLocation, condition);
+ }
+
+ public static void AddImport (
+ this MSBuildProject project,
+ string importedProjectFile,
+ ProjectImportLocation importLocation,
+ string condition)
+ {
+ XmlElement import = project.AddImportElement (importedProjectFile, importLocation);
+ import.SetAttribute ("Condition", condition);
+ }
+
+ static XmlElement AddImportElement(
+ this MSBuildProject project,
+ string importedProjectFile,
+ ProjectImportLocation importLocation)
+ {
+ if (importLocation == ProjectImportLocation.Top) {
+ return project.AddImportElementAtTop (importedProjectFile);
+ }
+ XmlElement import = project.CreateImportElement (importedProjectFile);
+ project.doc.DocumentElement.AppendChild (import);
+ return import;
+ }
+
+ static XmlElement CreateImportElement(this MSBuildProject project, string importedProjectFile)
+ {
+ XmlElement import = project.doc.CreateElement ("Import", MSBuildProject.Schema);
+ import.SetAttribute ("Project", importedProjectFile);
+ return import;
+ }
+
+ static XmlElement AddImportElementAtTop (this MSBuildProject project, string importedProjectFile)
+ {
+ XmlElement import = project.CreateImportElement (importedProjectFile);
+ XmlElement projectRoot = project.doc.DocumentElement;
+ projectRoot.InsertBefore (import, projectRoot.FirstChild);
+ return import;
+ }
+
+ public static void RemoveImportIfExists (this MSBuildProject project, string importedProjectFile)
+ {
+ XmlElement import = project.FindImportElement (importedProjectFile);
+ if (import != null) {
+ import.ParentNode.RemoveChild (import);
+ }
+ }
+
+ public static bool ImportExists (this MSBuildProject project, string importedProjectFile)
+ {
+ return project.FindImportElement (importedProjectFile) != null;
+ }
+
+ static XmlElement FindImportElement (this MSBuildProject project, string importedProjectFile)
+ {
+ return project
+ .Imports ()
+ .FirstOrDefault (import => String.Equals (import.GetAttribute ("Project"), importedProjectFile, StringComparison.OrdinalIgnoreCase));
+ }
+
+ static IEnumerable <XmlElement> Imports (this MSBuildProject project)
+ {
+ foreach (XmlElement import in project.doc.DocumentElement.SelectNodes ("tns:Import", namespaceManager)) {
+ yield return import;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MachinePackageCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MachinePackageCache.cs
new file mode 100644
index 0000000000..4b13b7c84b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MachinePackageCache.cs
@@ -0,0 +1,51 @@
+//
+// MachinePackageCache.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class MachinePackageCache : IMachinePackageCache
+ {
+ public IQueryable<IPackage> GetPackages()
+ {
+ return MachineCache.Default.GetPackages();
+ }
+
+ public void Clear()
+ {
+ MachineCache.Default.Clear();
+ }
+
+ public string Source {
+ get { return MachineCache.Default.Source; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesUserPrompts.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesUserPrompts.cs
new file mode 100644
index 0000000000..9680004b52
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesUserPrompts.cs
@@ -0,0 +1,124 @@
+//
+// ManagePackagesUserPrompts.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ManagePackagesUserPrompts
+ {
+ ILicenseAcceptanceService licenseAcceptanceService;
+ ISelectProjectsService selectProjectsService;
+ IPackageManagementEvents packageManagementEvents;
+ IFileConflictResolver fileConflictResolver;
+ FileConflictResolution lastFileConflictResolution;
+
+ public ManagePackagesUserPrompts(IPackageManagementEvents packageManagementEvents)
+ : this(
+ packageManagementEvents,
+ new LicenseAcceptanceService(),
+ new SelectProjectsService(),
+ new FileConflictResolver())
+ {
+ }
+
+ public ManagePackagesUserPrompts(
+ IPackageManagementEvents packageManagementEvents,
+ ILicenseAcceptanceService licenseAcceptanceService,
+ ISelectProjectsService selectProjectsService,
+ IFileConflictResolver fileConflictResolver)
+ {
+ this.packageManagementEvents = packageManagementEvents;
+ this.licenseAcceptanceService = licenseAcceptanceService;
+ this.selectProjectsService = selectProjectsService;
+ this.fileConflictResolver = fileConflictResolver;
+
+ ResetFileConflictResolution();
+ SubscribeToEvents();
+ }
+
+ void ResetFileConflictResolution()
+ {
+ lastFileConflictResolution = FileConflictResolution.Overwrite;
+ }
+
+ void SubscribeToEvents()
+ {
+ packageManagementEvents.AcceptLicenses += AcceptLicenses;
+ packageManagementEvents.SelectProjects += SelectProjects;
+ packageManagementEvents.ResolveFileConflict += ResolveFileConflict;
+ packageManagementEvents.PackageOperationsStarting += PackageOperationsStarting;
+ }
+
+ void AcceptLicenses(object sender, AcceptLicensesEventArgs e)
+ {
+ e.IsAccepted = licenseAcceptanceService.AcceptLicenses(e.Packages);
+ }
+
+ void SelectProjects(object sender, SelectProjectsEventArgs e)
+ {
+ e.IsAccepted = selectProjectsService.SelectProjects(e.SelectedProjects);
+ }
+
+ void ResolveFileConflict(object sender, ResolveFileConflictEventArgs e)
+ {
+ if (UserPreviouslySelectedOverwriteAllOrIgnoreAll()) {
+ e.Resolution = lastFileConflictResolution;
+ } else {
+ e.Resolution = fileConflictResolver.ResolveFileConflict(e.Message);
+ lastFileConflictResolution = e.Resolution;
+ }
+ }
+
+ bool UserPreviouslySelectedOverwriteAllOrIgnoreAll()
+ {
+ return
+ (lastFileConflictResolution == FileConflictResolution.IgnoreAll) ||
+ (lastFileConflictResolution == FileConflictResolution.OverwriteAll);
+ }
+
+ void PackageOperationsStarting(object sender, EventArgs e)
+ {
+ ResetFileConflictResolution();
+ }
+
+ public void Dispose()
+ {
+ UnsubscribeFromEvents();
+ }
+
+ public void UnsubscribeFromEvents()
+ {
+ packageManagementEvents.SelectProjects -= SelectProjects;
+ packageManagementEvents.AcceptLicenses -= AcceptLicenses;
+ packageManagementEvents.ResolveFileConflict -= ResolveFileConflict;
+ packageManagementEvents.PackageOperationsStarting -= PackageOperationsStarting;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewModel.cs
new file mode 100644
index 0000000000..5f811163a6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewModel.cs
@@ -0,0 +1,131 @@
+//
+// ManagePackagesViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ManagePackagesViewModel : ViewModelBase<ManagePackagesViewModel>, IDisposable
+ {
+ IThreadSafePackageManagementEvents packageManagementEvents;
+ ManagePackagesUserPrompts userPrompts;
+ PackagesViewModels packagesViewModels;
+ ManagePackagesViewTitle viewTitle;
+ string message;
+ bool hasError;
+
+ public ManagePackagesViewModel(
+ PackagesViewModels packagesViewModels,
+ ManagePackagesViewTitle viewTitle,
+ IThreadSafePackageManagementEvents packageManagementEvents,
+ ManagePackagesUserPrompts userPrompts)
+ {
+ this.packagesViewModels = packagesViewModels;
+ this.viewTitle = viewTitle;
+ this.packageManagementEvents = packageManagementEvents;
+ this.userPrompts = userPrompts;
+
+ packageManagementEvents.PackageOperationError += PackageOperationError;
+ packageManagementEvents.PackageOperationsStarting += PackageOperationsStarting;
+
+ packagesViewModels.ReadPackages();
+ }
+
+ public AvailablePackagesViewModel AvailablePackagesViewModel {
+ get { return packagesViewModels.AvailablePackagesViewModel; }
+ }
+
+ public InstalledPackagesViewModel InstalledPackagesViewModel {
+ get { return packagesViewModels.InstalledPackagesViewModel; }
+ }
+
+ public RecentPackagesViewModel RecentPackagesViewModel {
+ get { return packagesViewModels.RecentPackagesViewModel; }
+ }
+
+ public UpdatedPackagesViewModel UpdatedPackagesViewModel {
+ get { return packagesViewModels.UpdatedPackagesViewModel; }
+ }
+
+ public string Title {
+ get { return viewTitle.Title; }
+ }
+
+ public void Dispose()
+ {
+ packagesViewModels.Dispose();
+ userPrompts.Dispose();
+
+ packageManagementEvents.PackageOperationError -= PackageOperationError;
+ packageManagementEvents.PackageOperationsStarting -= PackageOperationsStarting;
+ packageManagementEvents.Dispose();
+ }
+
+ void PackageOperationError(object sender, PackageOperationExceptionEventArgs e)
+ {
+ ShowErrorMessage(e.Exception.Message);
+ }
+
+ void ShowErrorMessage(string message)
+ {
+ this.Message = message;
+ this.HasError = true;
+ }
+
+ public string Message {
+ get { return message; }
+ set {
+ message = value;
+ OnPropertyChanged(model => model.Message);
+ }
+ }
+
+ public bool HasError {
+ get { return hasError; }
+ set {
+ hasError = value;
+ OnPropertyChanged(model => model.HasError);
+ }
+ }
+
+ void PackageOperationsStarting(object sender, EventArgs e)
+ {
+ ClearMessage();
+ }
+
+ void ClearMessage()
+ {
+ this.Message = null;
+ this.HasError = false;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs
new file mode 100644
index 0000000000..c07724593c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs
@@ -0,0 +1,49 @@
+//
+// ManagePackagesViewTitle.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ManagePackagesViewTitle
+ {
+ public ManagePackagesViewTitle(IPackageManagementSolution solution)
+ {
+ GetTitle(solution);
+ }
+
+ void GetTitle(IPackageManagementSolution solution)
+ {
+ var selectedProjects = new PackageManagementSelectedProjects(solution);
+ string selectionName = selectedProjects.SelectionName;
+ Title = String.Format("{0} - Manage Packages", selectionName);
+ }
+
+ public string Title { get; private set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MarkupString.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MarkupString.cs
new file mode 100644
index 0000000000..3137ec55a0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MarkupString.cs
@@ -0,0 +1,43 @@
+//
+// StringExtensions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
+using GLib;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class MarkupString
+ {
+ public static string Format (string format, params string[] args)
+ {
+ string[] escapedArgs = args.Select (s => Markup.EscapeText (s)).ToArray();
+ return String.Format (format, escapedArgs);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopCredentialProvider.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopCredentialProvider.cs
new file mode 100644
index 0000000000..ef3e68c94b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopCredentialProvider.cs
@@ -0,0 +1,42 @@
+//
+// MonoDevelopCredentialProvider.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Net;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class MonoDevelopCredentialProvider : ICredentialProvider
+ {
+ public ICredentials GetCredentials(Uri uri, IWebProxy proxy, CredentialType credentialType, bool retrying)
+ {
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopHttpUserAgent.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopHttpUserAgent.cs
new file mode 100644
index 0000000000..6c8ec642c8
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopHttpUserAgent.cs
@@ -0,0 +1,64 @@
+//
+// SharpDevelopHttpUserAgent.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Core;
+using MonoDevelop.Ide;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class MonoDevelopHttpUserAgent
+ {
+ public MonoDevelopHttpUserAgent()
+ {
+ CreateUserAgent();
+ }
+
+ public string Client { get; private set; }
+ public string Host { get; private set; }
+ public string UserAgent { get; private set; }
+
+ void CreateUserAgent()
+ {
+ Client = BrandingService.ApplicationName;
+ Host = GetHost();
+ UserAgent = HttpUtility.CreateUserAgentString(Client, Host);
+ }
+
+ string GetHost()
+ {
+ return String.Format("{0}/{1}", Client, IdeApp.Version);
+ }
+
+ public override string ToString()
+ {
+ return UserAgent;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetExePath.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetExePath.cs
new file mode 100644
index 0000000000..e4646e019b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetExePath.cs
@@ -0,0 +1,46 @@
+//
+// NuGetExePath.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class NuGetExePath
+ {
+ public static string GetPath()
+ {
+ return Path.Combine(GetDirectory(), "NuGet.exe");
+ }
+
+ static string GetDirectory()
+ {
+ return Path.GetDirectoryName(typeof(NuGetExePath).Assembly.Location);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetPackageRestoreCommandLine.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetPackageRestoreCommandLine.cs
new file mode 100644
index 0000000000..6422633538
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetPackageRestoreCommandLine.cs
@@ -0,0 +1,92 @@
+//
+// NuGetPackageRestoreCommandLine.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using MonoDevelop.Core.Assemblies;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class NuGetPackageRestoreCommandLine
+ {
+ public NuGetPackageRestoreCommandLine(IPackageManagementSolution solution)
+ {
+ GenerateCommandLine(solution);
+ GenerateWorkingDirectory(solution);
+ }
+
+ public string Command { get; set; }
+ public string Arguments { get; private set; }
+ public string WorkingDirectory { get; private set; }
+
+ void GenerateCommandLine(IPackageManagementSolution solution)
+ {
+ if (EnvironmentUtility.IsMonoRuntime) {
+ GenerateMonoCommandLine(solution);
+ } else {
+ GenerateWindowsCommandLine(solution);
+ }
+ }
+
+ void GenerateMonoCommandLine(IPackageManagementSolution solution)
+ {
+ Arguments = String.Format(
+ "--runtime=v4.0 \"{0}\" restore \"{1}\"",
+ NuGetExePath.GetPath(),
+ solution.FileName);
+
+ string monoPrefix = MonoRuntimeInfo.FromCurrentRuntime().Prefix;
+ Command = Path.Combine(monoPrefix, "bin", "mono");
+ }
+
+ void GenerateWindowsCommandLine(IPackageManagementSolution solution)
+ {
+ Arguments = String.Format("restore \"{0}\"", solution.FileName);
+ Command = NuGetExePath.GetPath();
+ }
+
+ void GenerateWorkingDirectory(IPackageManagementSolution solution)
+ {
+ WorkingDirectory = Path.GetDirectoryName(solution.FileName);
+ }
+
+ public override string ToString()
+ {
+ return String.Format("{0} {1}", GetQuotedCommand(), Arguments);
+ }
+
+ string GetQuotedCommand()
+ {
+ if (Command.Contains(" ")) {
+ return String.Format("\"{0}\"", Command);
+ }
+ return Command;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenDotNetProjects.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenDotNetProjects.cs
new file mode 100644
index 0000000000..4845f95ae9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenDotNetProjects.cs
@@ -0,0 +1,65 @@
+//
+// OpenDotNetProjects.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Projects;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class OpenDotNetProjects
+ {
+ IPackageManagementProjectService projectService;
+
+ public OpenDotNetProjects(IPackageManagementProjectService projectService)
+ {
+ this.projectService = projectService;
+ }
+
+ public DotNetProject FindProject(string name)
+ {
+ foreach (Project project in projectService.GetOpenProjects()) {
+ if (IsProjectNameMatch(project, name)) {
+ return project as DotNetProject;
+ }
+ }
+ return null;
+ }
+
+ bool IsProjectNameMatch(Project project, string name)
+ {
+ return IsMatchIgnoringCase(project.Name, name) ||
+ (project.FileName == name);
+ }
+
+ bool IsMatchIgnoringCase(string a, string b)
+ {
+ return String.Equals(a, b, StringComparison.OrdinalIgnoreCase);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs
new file mode 100644
index 0000000000..9e5eebfacf
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageActionRunner.cs
@@ -0,0 +1,85 @@
+//
+// PackageActionRunner.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageActionRunner : IPackageActionRunner
+ {
+ IPackageManagementEvents packageManagementEvents;
+
+ public PackageActionRunner(IPackageManagementEvents packageManagementEvents)
+ {
+ this.packageManagementEvents = packageManagementEvents;
+ }
+
+ public void Run(IEnumerable<IPackageAction> actions)
+ {
+ if (ShouldRunActionsInConsole(actions)) {
+ ReportScriptsWillNotBeRun();
+ }
+
+ foreach (IPackageAction action in actions) {
+ action.Execute();
+ }
+ }
+
+ bool ShouldRunActionsInConsole(IEnumerable<IPackageAction> actions)
+ {
+ foreach (ProcessPackageAction action in actions) {
+ if (ShouldRunActionInConsole(action)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void Run(IPackageAction action)
+ {
+ if (ShouldRunActionInConsole(action)) {
+ ReportScriptsWillNotBeRun();
+ }
+
+ action.Execute();
+ }
+
+ bool ShouldRunActionInConsole(IPackageAction action)
+ {
+ return action.HasPackageScriptsToRun();
+ }
+
+ void ReportScriptsWillNotBeRun()
+ {
+ string message = "PowerShell scripts will not be run.";
+ packageManagementEvents.OnPackageOperationMessageLogged(MessageLevel.Warning, message);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFiles.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFiles.cs
new file mode 100644
index 0000000000..79d2189ecc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFiles.cs
@@ -0,0 +1,108 @@
+//
+// PackageFiles.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageFiles
+ {
+ IEnumerable<IPackageFile> files;
+
+ public PackageFiles(IPackage package)
+ : this(package.GetFiles())
+ {
+ }
+
+ public PackageFiles(IEnumerable<IPackageFile> files)
+ {
+ this.files = files;
+ }
+
+ public bool HasAnyPackageScripts()
+ {
+ foreach (string fileName in GetFileNames()) {
+ if (IsPackageScriptFile(fileName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ IEnumerable<string> GetFileNames()
+ {
+ foreach (IPackageFile file in files) {
+ string fileName = Path.GetFileName(file.Path);
+ yield return fileName;
+ }
+ }
+
+ public bool HasUninstallPackageScript()
+ {
+ foreach (string fileName in GetFileNames()) {
+ if (IsPackageUninstallScriptFile(fileName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool IsPackageScriptFile(string fileName)
+ {
+ return
+ IsPackageInitializationScriptFile(fileName) ||
+ IsPackageInstallScriptFile(fileName) ||
+ IsPackageUninstallScriptFile(fileName);
+ }
+
+ bool IsPackageInitializationScriptFile(string fileName)
+ {
+ return IsCaseInsensitiveMatch(fileName, "init.ps1");
+ }
+
+ bool IsPackageInstallScriptFile(string fileName)
+ {
+ return IsCaseInsensitiveMatch(fileName, "install.ps1");
+ }
+
+ bool IsPackageUninstallScriptFile(string fileName)
+ {
+ return IsCaseInsensitiveMatch(fileName, "uninstall.ps1");
+ }
+
+ bool IsCaseInsensitiveMatch(string a, string b)
+ {
+ return String.Equals(a, b, StringComparison.InvariantCultureIgnoreCase);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFilesForOperations.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFilesForOperations.cs
new file mode 100644
index 0000000000..9ebb699d91
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFilesForOperations.cs
@@ -0,0 +1,61 @@
+//
+// PackageFilesForOperations.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageFilesForOperations
+ {
+ IEnumerable<PackageOperation> operations;
+
+ public PackageFilesForOperations(IEnumerable<PackageOperation> operations)
+ {
+ this.operations = operations;
+ }
+
+ public bool HasAnyPackageScripts()
+ {
+ foreach (PackageFiles files in GetPackageFilesForEachOperation()) {
+ if (files.HasAnyPackageScripts()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ IEnumerable<PackageFiles> GetPackageFilesForEachOperation()
+ {
+ foreach (PackageOperation operation in operations) {
+ yield return new PackageFiles(operation.Package);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs
new file mode 100644
index 0000000000..ec6ceda798
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs
@@ -0,0 +1,221 @@
+//
+// PackageFromRepository.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Runtime.Versioning;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageFromRepository : IPackageFromRepository
+ {
+ IPackage package;
+ bool? hasDependencies;
+
+ public PackageFromRepository(IPackage package, IPackageRepository repository)
+ {
+ this.package = package;
+ this.Repository = repository;
+ }
+
+ public IPackageRepository Repository { get; private set; }
+
+ public IEnumerable<IPackageAssemblyReference> AssemblyReferences {
+ get { return package.AssemblyReferences; }
+ }
+
+ public string Id {
+ get { return package.Id; }
+ }
+
+ public SemanticVersion Version {
+ get { return package.Version; }
+ }
+
+ public string Title {
+ get { return package.Title; }
+ }
+
+ public IEnumerable<string> Authors {
+ get { return package.Authors; }
+ }
+
+ public IEnumerable<string> Owners {
+ get { return package.Owners; }
+ }
+
+ public Uri IconUrl {
+ get { return package.IconUrl; }
+ }
+
+ public Uri LicenseUrl {
+ get { return package.LicenseUrl; }
+ }
+
+ public Uri ProjectUrl {
+ get { return package.ProjectUrl;}
+ }
+
+ public bool RequireLicenseAcceptance {
+ get { return package.RequireLicenseAcceptance; }
+ }
+
+ public string Description {
+ get { return package.Description; }
+ }
+
+ public string Summary {
+ get { return package.Summary; }
+ }
+
+ public string Language {
+ get { return package.Language; }
+ }
+
+ public string Tags {
+ get { return package.Tags; }
+ }
+
+ public IEnumerable<FrameworkAssemblyReference> FrameworkAssemblies {
+ get { return package.FrameworkAssemblies; }
+ }
+
+ public IEnumerable<PackageDependency> Dependencies {
+ get { return package.GetCompatiblePackageDependencies(null); }
+ }
+
+ public Uri ReportAbuseUrl {
+ get { return package.ReportAbuseUrl; }
+ }
+
+ public int DownloadCount {
+ get { return package.DownloadCount; }
+ }
+
+ public DateTime? LastUpdated {
+ get { return GetLastUpdated(); }
+ }
+
+ DateTime? GetLastUpdated()
+ {
+ DateTimeOffset? lastUpdated = GetDataServicePackageLastUpdated();
+ if (lastUpdated.HasValue) {
+ return lastUpdated.Value.DateTime;
+ }
+ return null;
+ }
+
+ protected virtual DateTimeOffset? GetDataServicePackageLastUpdated()
+ {
+ var dataServicePackage = package as DataServicePackage;
+ if (dataServicePackage != null) {
+ return dataServicePackage.LastUpdated;
+ }
+ return null;
+ }
+
+ public IEnumerable<IPackageFile> GetFiles()
+ {
+ return package.GetFiles();
+ }
+
+ public Stream GetStream()
+ {
+ return package.GetStream();
+ }
+
+ public bool HasDependencies {
+ get {
+ if (!hasDependencies.HasValue) {
+ IEnumerator<PackageDependency> enumerator = Dependencies.GetEnumerator();
+ hasDependencies = enumerator.MoveNext();
+ }
+ return hasDependencies.Value;
+ }
+ }
+
+ public bool IsLatestVersion {
+ get { return package.IsLatestVersion; }
+ }
+
+ public Nullable<DateTimeOffset> Published {
+ get { return package.Published; }
+ }
+
+ public string ReleaseNotes {
+ get { return package.ReleaseNotes; }
+ }
+
+ public string Copyright {
+ get { return package.Copyright; }
+ }
+
+ public bool IsAbsoluteLatestVersion {
+ get { return package.IsAbsoluteLatestVersion; }
+ }
+
+ public bool Listed {
+ get { return package.Listed; }
+ }
+
+ public IEnumerable<PackageDependencySet> DependencySets {
+ get { return package.DependencySets; }
+ }
+
+ public IEnumerable<FrameworkName> GetSupportedFrameworks()
+ {
+ return package.GetSupportedFrameworks();
+ }
+
+ public override string ToString()
+ {
+ return package.ToString();
+ }
+
+ public ICollection<PackageReferenceSet> PackageAssemblyReferences {
+ get { return package.PackageAssemblyReferences; }
+ }
+
+ public Version MinClientVersion {
+ get { return package.MinClientVersion; }
+ }
+
+ public Uri GalleryUrl {
+ get {
+ var dataServicePackage = package as DataServicePackage;
+ if (dataServicePackage != null) {
+ return dataServicePackage.GalleryDetailsUrl;
+ }
+ return null;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageLicenseViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageLicenseViewModel.cs
new file mode 100644
index 0000000000..b6269554cc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageLicenseViewModel.cs
@@ -0,0 +1,55 @@
+//
+// PackageLicenseViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageLicenseViewModel : ViewModelBase<PackageLicenseViewModel>
+ {
+ IPackage package;
+
+ public PackageLicenseViewModel(IPackage package)
+ {
+ this.package = package;
+ }
+
+ public string Id {
+ get { return package.Id; }
+ }
+
+ public string Summary {
+ get { return package.SummaryOrDescription(); }
+ }
+
+ public Uri LicenseUrl {
+ get { return package.LicenseUrl; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementCompilerMessageView.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementCompilerMessageView.cs
new file mode 100644
index 0000000000..60d8f50aa1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementCompilerMessageView.cs
@@ -0,0 +1,51 @@
+//
+// PackageManagementCompilerMessageView.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementCompilerMessageView : ICompilerMessageView
+ {
+ public IMessageViewCategory Create(string categoryName, string categoryDisplayName)
+ {
+// MessageViewCategory view = null;
+// MessageViewCategory.Create(ref view, categoryName, categoryDisplayName);
+ return new PackageManagementMessageViewCategory();
+ }
+
+ public IMessageViewCategory GetExisting(string categoryName)
+ {
+// MessageViewCategory view = CompilerMessageView.Instance.GetCategory(categoryName);
+// if (view != null) {
+ return new PackageManagementMessageViewCategory();
+// }
+// return null;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEnumerableExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEnumerableExtensions.cs
new file mode 100644
index 0000000000..4033521c6e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEnumerableExtensions.cs
@@ -0,0 +1,55 @@
+//
+// PackageManagementEnumerableExtensions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class PackageManagementEnumerableExtensions
+ {
+ public static IEnumerable<TSource> DistinctLast<TSource>(this IEnumerable<TSource> source, IEqualityComparer<TSource> comparer)
+ {
+ TSource previousItem = default(TSource);
+
+ foreach (TSource currentItem in source) {
+ if (previousItem != null) {
+ if (!comparer.Equals(previousItem, currentItem)) {
+ yield return previousItem;
+ }
+ }
+ previousItem = currentItem;
+ }
+
+ if (previousItem != null) {
+ yield return previousItem;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEvents.cs
new file mode 100644
index 0000000000..f736ecb1a1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEvents.cs
@@ -0,0 +1,130 @@
+//
+// PackageManagementEvents.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Core;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementEvents : IPackageManagementEvents
+ {
+ public event EventHandler PackageOperationsStarting;
+
+ public void OnPackageOperationsStarting()
+ {
+ if (PackageOperationsStarting != null) {
+ PackageOperationsStarting(this, new EventArgs());
+ }
+ }
+
+ public event EventHandler<PackageOperationExceptionEventArgs> PackageOperationError;
+
+ public void OnPackageOperationError(Exception ex)
+ {
+ LoggingService.LogInfo("Package operation error: " + ex.ToString());
+ if (PackageOperationError != null) {
+ PackageOperationError(this, new PackageOperationExceptionEventArgs(ex));
+ }
+ }
+
+ public event EventHandler<AcceptLicensesEventArgs> AcceptLicenses;
+
+ public bool OnAcceptLicenses(IEnumerable<IPackage> packages)
+ {
+ if (AcceptLicenses != null) {
+ var eventArgs = new AcceptLicensesEventArgs(packages);
+ AcceptLicenses(this, eventArgs);
+ return eventArgs.IsAccepted;
+ }
+ return true;
+ }
+
+ public event EventHandler<ParentPackageOperationEventArgs> ParentPackageInstalled;
+
+ public void OnParentPackageInstalled(IPackage package)
+ {
+ if (ParentPackageInstalled != null) {
+ ParentPackageInstalled(this, new ParentPackageOperationEventArgs(package));
+ }
+ }
+
+ public event EventHandler<ParentPackageOperationEventArgs> ParentPackageUninstalled;
+
+ public void OnParentPackageUninstalled(IPackage package)
+ {
+ if (ParentPackageUninstalled != null) {
+ ParentPackageUninstalled(this, new ParentPackageOperationEventArgs(package));
+ }
+ }
+
+ public event EventHandler<PackageOperationMessageLoggedEventArgs> PackageOperationMessageLogged;
+
+ public void OnPackageOperationMessageLogged(MessageLevel level, string message, params object[] args)
+ {
+ if (PackageOperationMessageLogged != null) {
+ var eventArgs = new PackageOperationMessageLoggedEventArgs(level, message, args);
+ PackageOperationMessageLogged(this, eventArgs);
+ }
+ }
+
+ public event EventHandler<SelectProjectsEventArgs> SelectProjects;
+
+ public bool OnSelectProjects(IEnumerable<IPackageManagementSelectedProject> projects)
+ {
+ if (SelectProjects != null) {
+ var eventArgs = new SelectProjectsEventArgs(projects);
+ SelectProjects(this, eventArgs);
+ return eventArgs.IsAccepted;
+ }
+ return true;
+ }
+
+ public event EventHandler<ResolveFileConflictEventArgs> ResolveFileConflict;
+
+ public FileConflictResolution OnResolveFileConflict(string message)
+ {
+ if (ResolveFileConflict != null) {
+ var eventArgs = new ResolveFileConflictEventArgs(message);
+ ResolveFileConflict(this, eventArgs);
+ return eventArgs.Resolution;
+ }
+ return FileConflictResolution.IgnoreAll;
+ }
+
+ public event EventHandler<ParentPackagesOperationEventArgs> ParentPackagesUpdated;
+
+ public void OnParentPackagesUpdated(IEnumerable<IPackage> packages)
+ {
+ if (ParentPackagesUpdated != null) {
+ ParentPackagesUpdated(this, new ParentPackagesOperationEventArgs(packages));
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementFileService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementFileService.cs
new file mode 100644
index 0000000000..ab8f8dfd26
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementFileService.cs
@@ -0,0 +1,47 @@
+//
+// PackageManagementFileService.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using MonoDevelop.Core;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementFileService : IPackageManagementFileService
+ {
+ public void RemoveFile(string path)
+ {
+ FileService.DeleteFile(path);
+ }
+
+ public void RemoveDirectory(string path)
+ {
+ FileService.DeleteDirectory(path);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementLogger.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementLogger.cs
new file mode 100644
index 0000000000..c1e0f33bfc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementLogger.cs
@@ -0,0 +1,53 @@
+//
+// PackageManagementLogger.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementLogger : ILogger
+ {
+ IPackageManagementEvents packageManagementEvents;
+
+ public PackageManagementLogger(IPackageManagementEvents packageManagementEvents)
+ {
+ this.packageManagementEvents = packageManagementEvents;
+ }
+
+ public void Log(MessageLevel level, string message, params object[] args)
+ {
+ packageManagementEvents.OnPackageOperationMessageLogged(level, message, args);
+ }
+
+ public FileConflictResolution ResolveFileConflict(string message)
+ {
+ return packageManagementEvents.OnResolveFileConflict(message);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMessageViewCategory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMessageViewCategory.cs
new file mode 100644
index 0000000000..3bd784677f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMessageViewCategory.cs
@@ -0,0 +1,52 @@
+//
+// PackageManagementMessageViewCategory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementMessageViewCategory : IMessageViewCategory
+ {
+// MessageViewCategory messageViewCategory;
+//
+// public PackageManagementMessageViewCategory(MessageViewCategory messageViewCategory)
+// {
+// this.messageViewCategory = messageViewCategory;
+// }
+
+ public void AppendLine(string text)
+ {
+// messageViewCategory.AppendLine(text);
+ }
+
+ public void Clear()
+ {
+// messageViewCategory.ClearText();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptions.cs
new file mode 100644
index 0000000000..47a3f44471
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptions.cs
@@ -0,0 +1,99 @@
+//
+// PackageManagementOptions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+
+using MonoDevelop.Core;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementOptions
+ {
+ const string PackageDirectoryPropertyName = "PackagesDirectory";
+ const string RecentPackagesPropertyName = "RecentPackages";
+
+ RegisteredPackageSourceSettings registeredPackageSourceSettings;
+ Properties properties;
+ List<RecentPackageInfo> recentPackages;
+ PackageRestoreConsent packageRestoreConsent;
+
+ public PackageManagementOptions(Properties properties, ISettings settings)
+ {
+ this.properties = properties;
+ registeredPackageSourceSettings = new RegisteredPackageSourceSettings(settings);
+ packageRestoreConsent = new PackageRestoreConsent(settings);
+ }
+
+ public PackageManagementOptions(Properties properties)
+ : this(properties, Settings.LoadDefaultSettings(null, null, null))
+ {
+ }
+
+ public PackageManagementOptions()
+ : this(PropertyService.Get("PackageManagementSettings", new Properties()))
+ {
+ }
+
+ public bool IsPackageRestoreEnabled {
+ get { return packageRestoreConsent.IsGrantedInSettings; }
+ set { packageRestoreConsent.IsGrantedInSettings = value; }
+ }
+
+ public RegisteredPackageSources PackageSources {
+ get { return registeredPackageSourceSettings.PackageSources; }
+ }
+
+ public string PackagesDirectory {
+ get { return properties.Get(PackageDirectoryPropertyName, "packages"); }
+ set { properties.Set(PackageDirectoryPropertyName, value); }
+ }
+
+ public PackageSource ActivePackageSource {
+ get { return registeredPackageSourceSettings.ActivePackageSource; }
+ set { registeredPackageSourceSettings.ActivePackageSource = value; }
+ }
+
+ public IList<RecentPackageInfo> RecentPackages {
+ get {
+ if (recentPackages == null) {
+ ReadRecentPackages();
+ }
+ return recentPackages;
+ }
+ }
+
+ void ReadRecentPackages()
+ {
+ var defaultRecentPackages = new List<RecentPackageInfo>();
+ recentPackages = properties.Get<List<RecentPackageInfo>>(RecentPackagesPropertyName, defaultRecentPackages);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptionsViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptionsViewModel.cs
new file mode 100644
index 0000000000..2f511cfa4f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOptionsViewModel.cs
@@ -0,0 +1,116 @@
+//
+// PackageManagementOptionsViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementOptionsViewModel : ViewModelBase<PackageManagementOptionsViewModel>
+ {
+ PackageManagementOptions options;
+ IRecentPackageRepository recentPackageRepository;
+ IMachinePackageCache machinePackageCache;
+ IProcess process;
+
+ public PackageManagementOptionsViewModel(IRecentPackageRepository recentPackageRepository)
+ : this(PackageManagementServices.Options, recentPackageRepository, new MachinePackageCache(), new Process())
+ {
+ }
+
+ public PackageManagementOptionsViewModel(
+ PackageManagementOptions options,
+ IRecentPackageRepository recentPackageRepository,
+ IMachinePackageCache machinePackageCache,
+ IProcess process)
+ {
+ this.options = options;
+ this.recentPackageRepository = recentPackageRepository;
+ this.machinePackageCache = machinePackageCache;
+ this.process = process;
+
+ this.HasNoRecentPackages = !RecentPackageRepositoryHasPackages();
+ this.HasNoCachedPackages = !MachinePackageCacheHasPackages();
+ this.IsPackageRestoreEnabled = options.IsPackageRestoreEnabled;
+
+ CreateCommands();
+ }
+
+ public bool HasNoRecentPackages { get; private set; }
+ public bool HasNoCachedPackages { get; private set; }
+ public bool IsPackageRestoreEnabled { get; set; }
+
+ bool MachinePackageCacheHasPackages()
+ {
+ return machinePackageCache.GetPackages().Any();
+ }
+
+ bool RecentPackageRepositoryHasPackages()
+ {
+ return recentPackageRepository.HasRecentPackages;
+ }
+
+ void CreateCommands()
+ {
+ ClearRecentPackagesCommand =
+ new DelegateCommand(param => ClearRecentPackages(), param => !HasNoRecentPackages);
+ ClearCachedPackagesCommand =
+ new DelegateCommand(param => ClearCachedPackages(), param => !HasNoCachedPackages);
+ BrowseCachedPackagesCommand =
+ new DelegateCommand(param => BrowseCachedPackages(), param => !HasNoCachedPackages);
+ }
+
+ public ICommand ClearRecentPackagesCommand { get; private set; }
+ public ICommand ClearCachedPackagesCommand { get; private set; }
+ public ICommand BrowseCachedPackagesCommand { get; private set; }
+
+ public void ClearRecentPackages()
+ {
+ recentPackageRepository.Clear();
+ HasNoRecentPackages = true;
+ OnPropertyChanged(viewModel => viewModel.HasNoRecentPackages);
+ }
+
+ public void ClearCachedPackages()
+ {
+ machinePackageCache.Clear();
+ HasNoCachedPackages = true;
+ OnPropertyChanged(viewModel => viewModel.HasNoCachedPackages);
+ }
+
+ public void BrowseCachedPackages()
+ {
+ process.Start(machinePackageCache.Source);
+ }
+
+ public void SaveOptions()
+ {
+ options.IsPackageRestoreEnabled = IsPackageRestoreEnabled;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOutputMessagesView.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOutputMessagesView.cs
new file mode 100644
index 0000000000..87614c038e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementOutputMessagesView.cs
@@ -0,0 +1,77 @@
+//
+// PackageManagementOutputMessagesView.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementOutputMessagesView : IPackageManagementOutputMessagesView
+ {
+ public static readonly string CategoryName = "PackageManagement";
+
+ IMessageViewCategory messageViewCategory;
+
+ public PackageManagementOutputMessagesView(IPackageManagementEvents packageManagementEvents)
+ : this(new PackageManagementCompilerMessageView(), packageManagementEvents)
+ {
+ }
+
+ public PackageManagementOutputMessagesView(
+ ICompilerMessageView compilerMessageView,
+ IPackageManagementEvents packageManagementEvents)
+ {
+ CreatePackageManagementMessageCategoryIfNoneExists(compilerMessageView);
+ packageManagementEvents.PackageOperationMessageLogged += PackageOperationMessageLogged;
+ }
+
+ void CreatePackageManagementMessageCategoryIfNoneExists(ICompilerMessageView compilerMessageView)
+ {
+ messageViewCategory = compilerMessageView.GetExisting(CategoryName);
+ if (messageViewCategory == null) {
+ CreatePackageManagementMessageCategory(compilerMessageView);
+ }
+ }
+
+ void CreatePackageManagementMessageCategory(ICompilerMessageView compilerMessageView)
+ {
+ messageViewCategory = compilerMessageView.Create(CategoryName, "Packages");
+ }
+
+ void PackageOperationMessageLogged(object sender, PackageOperationMessageLoggedEventArgs e)
+ {
+ string formattedMessage = e.Message.ToString();
+ messageViewCategory.AppendLine(formattedMessage);
+ }
+
+ public void Clear()
+ {
+ messageViewCategory.Clear();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProject.cs
new file mode 100644
index 0000000000..b16e70065a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProject.cs
@@ -0,0 +1,186 @@
+//
+// PackageManagementProject.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementProject : IPackageManagementProject
+ {
+ ISharpDevelopPackageManager packageManager;
+ ISharpDevelopProjectManager projectManager;
+ IPackageManagementEvents packageManagementEvents;
+ DotNetProject msbuildProject;
+
+ public PackageManagementProject(
+ IPackageRepository sourceRepository,
+ DotNetProject project,
+ IPackageManagementEvents packageManagementEvents,
+ IPackageManagerFactory packageManagerFactory)
+ {
+ SourceRepository = sourceRepository;
+ msbuildProject = project;
+ this.packageManagementEvents = packageManagementEvents;
+
+ packageManager = packageManagerFactory.CreatePackageManager(sourceRepository, project);
+ projectManager = packageManager.ProjectManager;
+ }
+
+ public string Name {
+ get { return msbuildProject.Name; }
+ }
+
+ public IPackageRepository SourceRepository { get; private set; }
+
+ public ILogger Logger {
+ get { return packageManager.Logger; }
+ set {
+ packageManager.Logger = value;
+ packageManager.FileSystem.Logger = value;
+
+ projectManager.Logger = value;
+ projectManager.Project.Logger = value;
+ }
+ }
+
+ public event EventHandler<PackageOperationEventArgs> PackageInstalled {
+ add { packageManager.PackageInstalled += value; }
+ remove { packageManager.PackageInstalled -= value; }
+ }
+
+ public event EventHandler<PackageOperationEventArgs> PackageUninstalled {
+ add { packageManager.PackageUninstalled += value; }
+ remove { packageManager.PackageUninstalled -= value; }
+ }
+
+ public event EventHandler<PackageOperationEventArgs> PackageReferenceAdded {
+ add { projectManager.PackageReferenceAdded += value; }
+ remove { projectManager.PackageReferenceAdded -= value; }
+ }
+
+ public event EventHandler<PackageOperationEventArgs> PackageReferenceRemoved {
+ add { projectManager.PackageReferenceRemoved += value; }
+ remove { projectManager.PackageReferenceRemoved -= value; }
+ }
+
+ public bool IsPackageInstalled(IPackage package)
+ {
+ return projectManager.IsInstalled(package);
+ }
+
+ public bool IsPackageInstalled(string packageId)
+ {
+ return projectManager.IsInstalled(packageId);
+ }
+
+ public IQueryable<IPackage> GetPackages()
+ {
+ return projectManager.LocalRepository.GetPackages();
+ }
+
+ public IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction)
+ {
+ return packageManager.GetInstallPackageOperations(package, installAction);
+ }
+
+ public void InstallPackage(IPackage package, InstallPackageAction installAction)
+ {
+ packageManager.InstallPackage(package, installAction);
+ }
+
+ public void UninstallPackage(IPackage package, UninstallPackageAction uninstallAction)
+ {
+ packageManager.UninstallPackage(package, uninstallAction);
+ }
+
+ public void UpdatePackage(IPackage package, UpdatePackageAction updateAction)
+ {
+ packageManager.UpdatePackage(package, updateAction);
+ }
+
+ public InstallPackageAction CreateInstallPackageAction()
+ {
+ return new InstallPackageAction(this, packageManagementEvents);
+ }
+
+ public UninstallPackageAction CreateUninstallPackageAction()
+ {
+ return new UninstallPackageAction(this, packageManagementEvents);
+ }
+
+ public UpdatePackageAction CreateUpdatePackageAction()
+ {
+ return new UpdatePackageAction(this, packageManagementEvents);
+ }
+
+ public IEnumerable<IPackage> GetPackagesInReverseDependencyOrder()
+ {
+ var packageSorter = new PackageSorter(null);
+ return packageSorter
+ .GetPackagesByDependencyOrder(projectManager.LocalRepository)
+ .Reverse();
+ }
+
+ public void UpdatePackages(UpdatePackagesAction updateAction)
+ {
+ packageManager.UpdatePackages(updateAction);
+ }
+
+ public UpdatePackagesAction CreateUpdatePackagesAction()
+ {
+ return new UpdatePackagesAction(this, packageManagementEvents);
+ }
+
+ public IEnumerable<PackageOperation> GetUpdatePackagesOperations(
+ IEnumerable<IPackage> packages,
+ IUpdatePackageSettings settings)
+ {
+ return packageManager.GetUpdatePackageOperations(packages, settings);
+ }
+
+ public void RunPackageOperations(IEnumerable<PackageOperation> operations)
+ {
+ packageManager.RunPackageOperations(operations);
+ }
+
+ public bool HasOlderPackageInstalled(IPackage package)
+ {
+ return projectManager.HasOlderPackageInstalled(package);
+ }
+
+ public void UpdatePackageReference(IPackage package, IUpdatePackageSettings settings)
+ {
+ packageManager.UpdatePackageReference(package, settings);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectFactory.cs
new file mode 100644
index 0000000000..5e3c276d1f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectFactory.cs
@@ -0,0 +1,52 @@
+//
+// PackageManagementProjectFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementProjectFactory : IPackageManagementProjectFactory
+ {
+ SharpDevelopPackageManagerFactory factory = new SharpDevelopPackageManagerFactory();
+ IPackageManagementEvents packageManagementEvents;
+
+ public PackageManagementProjectFactory(IPackageManagementEvents packageManagementEvents)
+ {
+ this.packageManagementEvents = packageManagementEvents;
+ }
+
+ public IPackageManagementProject CreateProject(
+ IPackageRepository sourceRepository,
+ DotNetProject project)
+ {
+ return new PackageManagementProject(sourceRepository, project, packageManagementEvents, factory);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectService.cs
new file mode 100644
index 0000000000..d12cebd707
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectService.cs
@@ -0,0 +1,81 @@
+//
+// PackageManagementProjectService.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Ide;
+using MonoDevelop.Projects;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementProjectService : IPackageManagementProjectService
+ {
+ public PackageManagementProjectService()
+ {
+ }
+
+ public Project CurrentProject {
+ get { return IdeApp.ProjectOperations.CurrentSelectedProject; }
+ }
+
+ public Solution OpenSolution {
+ get { return IdeApp.ProjectOperations.CurrentSelectedSolution; }
+ }
+
+ public IEnumerable<Project> GetOpenProjects()
+ {
+ Solution solution = OpenSolution;
+ if (solution != null) {
+ return solution.GetAllProjects();
+ }
+ return new Project[0];
+ }
+
+ public void Save(Project project)
+ {
+ project.Save();
+ }
+
+ public void Save(Solution solution)
+ {
+ solution.Save();
+ }
+
+ public IProjectBrowserUpdater CreateProjectBrowserUpdater()
+ {
+ return new ThreadSafeProjectBrowserUpdater();
+ }
+
+ public string GetDefaultCustomToolForFileName(ProjectFile projectItem)
+ {
+ return String.Empty;
+ //return CustomToolsService.GetCompatibleCustomToolNames(projectItem).FirstOrDefault();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementPropertyService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementPropertyService.cs
new file mode 100644
index 0000000000..ea0936f826
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementPropertyService.cs
@@ -0,0 +1,44 @@
+//
+// PackageManagementPropertyService.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Core;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementPropertyService : IPropertyService
+ {
+ public string DataDirectory {
+ get { return UserProfile.Current.ConfigDir; }
+ }
+
+ public string ConfigDirectory {
+ get { return UserProfile.Current.ConfigDir; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProject.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProject.cs
new file mode 100644
index 0000000000..c2fb5ca2f1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProject.cs
@@ -0,0 +1,64 @@
+//
+// PackageManagementSelectedProject.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementSelectedProject : IPackageManagementSelectedProject
+ {
+ public PackageManagementSelectedProject(IPackageManagementProject project)
+ : this(project, selected: false)
+ {
+ }
+
+ public PackageManagementSelectedProject(
+ IPackageManagementProject project,
+ bool selected)
+ : this(project, selected, enabled: true)
+ {
+ }
+
+ public PackageManagementSelectedProject(
+ IPackageManagementProject project,
+ bool selected,
+ bool enabled)
+ {
+ this.Project = project;
+ this.Name = Project.Name;
+ this.IsSelected = selected;
+ this.IsEnabled = enabled;
+ }
+
+ public IPackageManagementProject Project { get; private set; }
+ public string Name { get; private set; }
+
+ public bool IsSelected { get; set; }
+ public bool IsEnabled { get; set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProjects.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProjects.cs
new file mode 100644
index 0000000000..bc0350cac0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSelectedProjects.cs
@@ -0,0 +1,181 @@
+//
+// PackageManagementSelectedProjects.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementSelectedProjects
+ {
+ bool? singleProjectSelected;
+ Project singleDotNetProjectSelected;
+
+ public PackageManagementSelectedProjects(IPackageManagementSolution solution)
+ {
+ this.Solution = solution;
+ GetHasSingleProjectSelected();
+ }
+
+ public IPackageManagementSolution Solution { get; private set; }
+
+ public IEnumerable<IPackageManagementSelectedProject> GetProjects(IPackageFromRepository package)
+ {
+ if (HasSingleProjectSelected()) {
+ yield return GetSingleProjectSelected(package);
+ } else {
+ foreach (Project project in GetOpenProjects()) {
+ yield return CreateSelectedProject(project, package);
+ }
+ }
+ }
+
+ public bool HasSingleProjectSelected()
+ {
+ if (!singleProjectSelected.HasValue) {
+ GetHasSingleProjectSelected();
+ }
+ return singleProjectSelected.Value;
+ }
+
+ void GetHasSingleProjectSelected()
+ {
+ singleDotNetProjectSelected = Solution.GetActiveDotNetProject();
+ singleProjectSelected = singleDotNetProjectSelected != null;
+ }
+
+ IEnumerable<Project> GetOpenProjects()
+ {
+ return Solution.GetDotNetProjects();
+ }
+
+ IPackageManagementSelectedProject GetSingleProjectSelected(IPackageFromRepository package)
+ {
+ return CreateSelectedProject(singleDotNetProjectSelected, package);
+ }
+
+ IPackageManagementSelectedProject CreateSelectedProject(Project dotNetProject, IPackageFromRepository package)
+ {
+ IPackageManagementProject project = Solution.GetProject(package.Repository, dotNetProject);
+ return CreateSelectedProject(project, package);
+ }
+
+ IPackageManagementSelectedProject CreateSelectedProject(
+ IPackageManagementProject project,
+ IPackageFromRepository package)
+ {
+ bool enabled = IsProjectEnabled(project, package);
+ bool selected = IsProjectSelected(project, package);
+ return new PackageManagementSelectedProject(project, selected, enabled);
+ }
+
+ protected virtual bool IsProjectSelected(IPackageManagementProject project, IPackageFromRepository package)
+ {
+ return false;
+ }
+
+ protected virtual bool IsProjectEnabled(IPackageManagementProject project, IPackageFromRepository package)
+ {
+ return true;
+ }
+
+ public bool HasMultipleProjects()
+ {
+ if (HasSingleProjectSelected()) {
+ return false;
+ }
+ return Solution.HasMultipleProjects();
+ }
+
+ public string SelectionName {
+ get { return GetSelectionName(); }
+ }
+
+ string GetSelectionName()
+ {
+ if (HasSingleProjectSelected()) {
+ return GetSingleProjectSelectedName();
+ }
+ return GetSolutionFileNameWithoutFullPath();
+ }
+
+ string GetSingleProjectSelectedName()
+ {
+ return singleDotNetProjectSelected.Name;
+ }
+
+ string GetSolutionFileNameWithoutFullPath()
+ {
+ return Path.GetFileName(Solution.FileName);
+ }
+
+ /// <summary>
+ /// Returns true if the package is installed in the selected projects.
+ /// </summary>
+ public bool IsPackageInstalled(IPackageFromRepository package)
+ {
+ if (HasSingleProjectSelected()) {
+ IPackageManagementProject project = GetSingleProjectSelected(package.Repository);
+ return project.IsPackageInstalled(package);
+ }
+ return IsPackageInstalledInSolution(package);
+ }
+
+ public bool IsPackageInstalledInSolution(IPackage package)
+ {
+ return Solution.IsPackageInstalled(package);
+ }
+
+ public IQueryable<IPackage> GetPackagesInstalledInSolution()
+ {
+ return Solution.GetPackages();
+ }
+
+ public IQueryable<IPackage> GetInstalledPackages(IPackageRepository sourceRepository)
+ {
+ if (HasSingleProjectSelected()) {
+ IPackageManagementProject project = GetSingleProjectSelected(sourceRepository);
+ return project.GetPackages();
+ }
+ return GetPackagesInstalledInSolution();
+ }
+
+ public IPackageManagementProject GetSingleProjectSelected(IPackageRepository repository)
+ {
+ if (HasSingleProjectSelected()) {
+ return Solution.GetProject(repository, singleDotNetProjectSelected);
+ }
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs
new file mode 100644
index 0000000000..e78f3eb8b0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs
@@ -0,0 +1,113 @@
+//
+// PackageManagementServices.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class PackageManagementServices
+ {
+ static readonly PackageManagementOptions options;
+ static readonly PackageManagementSolution solution;
+ static readonly RegisteredPackageRepositories registeredPackageRepositories;
+ static readonly PackageManagementEvents packageManagementEvents = new PackageManagementEvents();
+ static readonly PackageManagementProjectService projectService = new PackageManagementProjectService();
+ static readonly PackageManagementOutputMessagesView outputMessagesView;
+ static readonly PackageActionRunner packageActionRunner;
+ static readonly IPackageRepositoryCache projectTemplatePackageRepositoryCache;
+ static readonly RegisteredProjectTemplatePackageSources projectTemplatePackageSources;
+ static readonly PackageRepositoryCache packageRepositoryCache;
+ static readonly UserAgentGeneratorForRepositoryRequests userAgentGenerator;
+
+ static PackageManagementServices()
+ {
+ options = new PackageManagementOptions();
+ packageRepositoryCache = new PackageRepositoryCache(options.PackageSources, options.RecentPackages);
+ userAgentGenerator = new UserAgentGeneratorForRepositoryRequests(packageRepositoryCache);
+ registeredPackageRepositories = new RegisteredPackageRepositories(packageRepositoryCache, options);
+ //projectTemplatePackageSources = new RegisteredProjectTemplatePackageSources();
+ //projectTemplatePackageRepositoryCache = new ProjectTemplatePackageRepositoryCache(packageRepositoryCache, projectTemplatePackageSources);
+
+ outputMessagesView = new PackageManagementOutputMessagesView(packageManagementEvents);
+ solution = new PackageManagementSolution(registeredPackageRepositories, packageManagementEvents);
+ packageActionRunner = new PackageActionRunner(packageManagementEvents);
+
+ InitializeCredentialProvider();
+ }
+
+ static void InitializeCredentialProvider()
+ {
+ ISettings settings = Settings.LoadDefaultSettings(null, null, null);
+ var packageSourceProvider = new PackageSourceProvider(settings);
+ var credentialProvider = new SettingsCredentialProvider(new MonoDevelopCredentialProvider(), packageSourceProvider);
+
+ HttpClient.DefaultCredentialProvider = credentialProvider;
+ }
+
+ public static PackageManagementOptions Options {
+ get { return options; }
+ }
+
+ public static IPackageManagementSolution Solution {
+ get { return solution; }
+ }
+
+ public static IRegisteredPackageRepositories RegisteredPackageRepositories {
+ get { return registeredPackageRepositories; }
+ }
+
+ public static IPackageRepositoryCache PackageRepositoryCache {
+ get { return packageRepositoryCache; }
+ }
+
+ public static IPackageManagementEvents PackageManagementEvents {
+ get { return packageManagementEvents; }
+ }
+
+ public static IPackageManagementOutputMessagesView OutputMessagesView {
+ get { return outputMessagesView; }
+ }
+
+ public static IPackageManagementProjectService ProjectService {
+ get { return projectService; }
+ }
+
+ public static IPackageActionRunner PackageActionRunner {
+ get { return packageActionRunner; }
+ }
+
+ public static IPackageRepositoryCache ProjectTemplatePackageRepositoryCache {
+ get { return projectTemplatePackageRepositoryCache; }
+ }
+
+ public static RegisteredPackageSources ProjectTemplatePackageSources {
+ get { return projectTemplatePackageSources.PackageSources; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolution.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolution.cs
new file mode 100644
index 0000000000..cadcd39ca0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolution.cs
@@ -0,0 +1,207 @@
+//
+// PackageManagementSolution.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementSolution : IPackageManagementSolution
+ {
+ IRegisteredPackageRepositories registeredPackageRepositories;
+ IPackageManagementProjectService projectService;
+ IPackageManagementProjectFactory projectFactory;
+ ISolutionPackageRepositoryFactory solutionPackageRepositoryFactory;
+
+ public PackageManagementSolution(
+ IRegisteredPackageRepositories registeredPackageRepositories,
+ IPackageManagementEvents packageManagementEvents)
+ : this(
+ registeredPackageRepositories,
+ new PackageManagementProjectService(),
+ new PackageManagementProjectFactory(packageManagementEvents),
+ new SolutionPackageRepositoryFactory())
+ {
+ }
+
+ public PackageManagementSolution(
+ IRegisteredPackageRepositories registeredPackageRepositories,
+ IPackageManagementProjectService projectService,
+ IPackageManagementProjectFactory projectFactory,
+ ISolutionPackageRepositoryFactory solutionPackageRepositoryFactory)
+ {
+ this.registeredPackageRepositories = registeredPackageRepositories;
+ this.projectFactory = projectFactory;
+ this.projectService = projectService;
+ this.solutionPackageRepositoryFactory = solutionPackageRepositoryFactory;
+ }
+
+ public string FileName {
+ get { return OpenSolution.FileName; }
+ }
+
+ Solution OpenSolution {
+ get { return projectService.OpenSolution; }
+ }
+
+ public IPackageManagementProject GetActiveProject()
+ {
+ if (HasActiveProject()) {
+ return GetActiveProject(ActivePackageRepository);
+ }
+ return null;
+ }
+
+ bool HasActiveProject()
+ {
+ return GetActiveDotNetProject() != null;
+ }
+
+ public Project GetActiveDotNetProject()
+ {
+ return projectService.CurrentProject;
+ }
+
+ IPackageRepository ActivePackageRepository {
+ get { return registeredPackageRepositories.ActiveRepository; }
+ }
+
+ public IPackageManagementProject GetActiveProject(IPackageRepository sourceRepository)
+ {
+ var activeProject = GetActiveDotNetProject() as DotNetProject;
+ if (activeProject != null) {
+ return CreateProject(sourceRepository, activeProject);
+ }
+ return null;
+ }
+
+ IPackageManagementProject CreateProject(IPackageRepository sourceRepository, DotNetProject project)
+ {
+ return projectFactory.CreateProject(sourceRepository, project);
+ }
+
+ IPackageRepository CreatePackageRepository(PackageSource source)
+ {
+ return registeredPackageRepositories.CreateRepository(source);
+ }
+
+ public IPackageManagementProject GetProject(PackageSource source, string projectName)
+ {
+ DotNetProject project = GetDotNetProject(projectName);
+ return CreateProject(source, project);
+ }
+
+ DotNetProject GetDotNetProject(string name)
+ {
+ var openProjects = new OpenDotNetProjects(projectService);
+ return openProjects.FindProject(name);
+ }
+
+ IPackageManagementProject CreateProject(PackageSource source, DotNetProject project)
+ {
+ IPackageRepository sourceRepository = CreatePackageRepository(source);
+ return CreateProject(sourceRepository, project);
+ }
+
+ public IPackageManagementProject GetProject(IPackageRepository sourceRepository, string projectName)
+ {
+ DotNetProject project = GetDotNetProject(projectName);
+ return CreateProject(sourceRepository, project);
+ }
+
+ public IPackageManagementProject GetProject(IPackageRepository sourceRepository, Project project)
+ {
+ var dotNetProject = project as DotNetProject;
+ return CreateProject(sourceRepository, dotNetProject);
+ }
+
+ public IEnumerable<Project> GetDotNetProjects()
+ {
+ return projectService.GetOpenProjects();
+ }
+
+ public bool IsOpen {
+ get { return OpenSolution != null; }
+ }
+
+ public bool HasMultipleProjects()
+ {
+ return projectService.GetOpenProjects().Count() > 1;
+ }
+
+ public bool IsPackageInstalled(IPackage package)
+ {
+ ISolutionPackageRepository repository = CreateSolutionPackageRepository();
+ return repository.IsInstalled(package);
+ }
+
+ ISolutionPackageRepository CreateSolutionPackageRepository()
+ {
+ return solutionPackageRepositoryFactory.CreateSolutionPackageRepository(OpenSolution);
+ }
+
+ public IQueryable<IPackage> GetPackages()
+ {
+ ISolutionPackageRepository repository = CreateSolutionPackageRepository();
+ List<IPackageManagementProject> projects = GetProjects(ActivePackageRepository).ToList();
+ return repository
+ .GetPackages()
+ .Where(package => IsPackageInstalledInSolutionOrAnyProject(projects, package));
+ }
+
+ bool IsPackageInstalledInSolutionOrAnyProject(IList<IPackageManagementProject> projects, IPackage package)
+ {
+ if (projects.Any(project => project.IsPackageInstalled(package))) {
+ return true;
+ }
+ return false;
+ }
+
+ public string GetInstallPath(IPackage package)
+ {
+ ISolutionPackageRepository repository = CreateSolutionPackageRepository();
+ return repository.GetInstallPath(package);
+ }
+
+ public IEnumerable<IPackage> GetPackagesInReverseDependencyOrder()
+ {
+ ISolutionPackageRepository repository = CreateSolutionPackageRepository();
+ return repository.GetPackagesByReverseDependencyOrder();
+ }
+
+ public IEnumerable<IPackageManagementProject> GetProjects(IPackageRepository sourceRepository)
+ {
+ foreach (DotNetProject dotNetProject in GetDotNetProjects()) {
+ yield return projectFactory.CreateProject(sourceRepository, dotNetProject);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTask.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTask.cs
new file mode 100644
index 0000000000..18f1c2c769
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTask.cs
@@ -0,0 +1,88 @@
+//
+// PackageManagementTask.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementTask<TResult> : ITask<TResult>
+ {
+ Task<TResult> task;
+ Action<ITask<TResult>> continueWith;
+ CancellationTokenSource cancellationTokenSource;
+
+ public PackageManagementTask(
+ Func<TResult> function,
+ Action<ITask<TResult>> continueWith)
+ {
+ this.continueWith = continueWith;
+ CreateTask(function);
+ }
+
+ void CreateTask(Func<TResult> function)
+ {
+ TaskScheduler scheduler = TaskScheduler.FromCurrentSynchronizationContext();
+ cancellationTokenSource = new CancellationTokenSource();
+ task = new Task<TResult>(function, cancellationTokenSource.Token);
+ task.ContinueWith(result => OnContinueWith(result), scheduler);
+ }
+
+ void OnContinueWith(Task<TResult> task)
+ {
+ continueWith(this);
+ }
+
+ public void Start()
+ {
+ task.Start();
+ }
+
+ public TResult Result {
+ get { return task.Result; }
+ }
+
+ public void Cancel()
+ {
+ cancellationTokenSource.Cancel();
+ }
+
+ public bool IsCancelled {
+ get { return task.IsCanceled; }
+ }
+
+ public bool IsFaulted {
+ get { return task.IsFaulted; }
+ }
+
+ public AggregateException Exception {
+ get { return task.Exception; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTaskFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTaskFactory.cs
new file mode 100644
index 0000000000..6189173548
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTaskFactory.cs
@@ -0,0 +1,46 @@
+//
+// PackageManagementTaskFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementTaskFactory : ITaskFactory
+ {
+ public ITask<TResult> CreateTask<TResult>(
+ Func<TResult> function,
+ Action<ITask<TResult>> continueWith)
+ {
+ return new PackageManagementTask<TResult>(function, continueWith);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementViewModels.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementViewModels.cs
new file mode 100644
index 0000000000..331dae10d1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementViewModels.cs
@@ -0,0 +1,149 @@
+//
+// PackageManagementViewModels.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageManagementViewModels
+ {
+ ManagePackagesViewModel managePackagesViewModel;
+ RegisteredPackageSourcesViewModel registeredPackageSourcesViewModel;
+ RegisteredPackageSourcesViewModel registeredProjectTemplatePackageSourcesViewModel;
+ PackageManagementOptionsViewModel packageManagementOptionsViewModel;
+ IPackageManagementSolution solution;
+ IRegisteredPackageRepositories registeredPackageRepositories;
+
+ public ManagePackagesViewModel ManagePackagesViewModel {
+ get {
+ CreateManagePackagesViewModel();
+ return managePackagesViewModel;
+ }
+ }
+
+ void CreateManagePackagesViewModel()
+ {
+ CreateRegisteredPackageRepositories();
+ CreateSolution();
+ ThreadSafePackageManagementEvents packageManagementEvents = CreateThreadSafePackageManagementEvents();
+ PackagesViewModels packagesViewModels = CreatePackagesViewModels(packageManagementEvents);
+
+ managePackagesViewModel =
+ new ManagePackagesViewModel(
+ packagesViewModels,
+ new ManagePackagesViewTitle(solution),
+ packageManagementEvents,
+ new ManagePackagesUserPrompts(packageManagementEvents));
+ }
+
+ void CreateRegisteredPackageRepositories()
+ {
+ if (registeredPackageRepositories == null) {
+ registeredPackageRepositories = PackageManagementServices.RegisteredPackageRepositories;
+ }
+ }
+
+ void CreateSolution()
+ {
+ if (solution == null) {
+ solution = PackageManagementServices.Solution;
+ }
+ }
+
+ ThreadSafePackageManagementEvents CreateThreadSafePackageManagementEvents()
+ {
+ return new ThreadSafePackageManagementEvents(
+ PackageManagementServices.PackageManagementEvents);
+ }
+
+ PackagesViewModels CreatePackagesViewModels(IThreadSafePackageManagementEvents packageManagementEvents)
+ {
+ return new PackagesViewModels(
+ solution,
+ registeredPackageRepositories,
+ packageManagementEvents,
+ PackageManagementServices.PackageActionRunner,
+ new PackageManagementTaskFactory());
+ }
+
+ public RegisteredPackageSourcesViewModel RegisteredPackageSourcesViewModel {
+ get {
+ if (registeredPackageSourcesViewModel == null) {
+ RegisteredPackageSources packageSources = GetRegisteredPackageSources();
+ registeredPackageSourcesViewModel =
+ CreateRegisteredPackageSourcesViewModel(packageSources);
+ }
+ return registeredPackageSourcesViewModel;
+ }
+ }
+
+ RegisteredPackageSources GetRegisteredPackageSources()
+ {
+ return PackageManagementServices.Options.PackageSources;
+ }
+
+ RegisteredPackageSources CreateDesignTimeRegisteredPackageSources()
+ {
+ return new RegisteredPackageSources(new PackageSource[0]);
+ }
+
+ RegisteredPackageSourcesViewModel CreateRegisteredPackageSourcesViewModel(RegisteredPackageSources packageSources)
+ {
+ CreateRegisteredPackageRepositories();
+ return new RegisteredPackageSourcesViewModel(packageSources);
+ }
+
+ public RegisteredPackageSourcesViewModel RegisteredProjectTemplatePackageSourcesViewModel {
+ get {
+ if (registeredProjectTemplatePackageSourcesViewModel == null) {
+ RegisteredPackageSources packageSources = GetProjectTemplatePackageSources();
+ registeredProjectTemplatePackageSourcesViewModel =
+ CreateRegisteredPackageSourcesViewModel(packageSources);
+ }
+ return registeredProjectTemplatePackageSourcesViewModel;
+ }
+ }
+
+ RegisteredPackageSources GetProjectTemplatePackageSources()
+ {
+ return PackageManagementServices.ProjectTemplatePackageSources;
+ }
+
+ public PackageManagementOptionsViewModel PackageManagementOptionsViewModel {
+ get {
+ if (packageManagementOptionsViewModel == null) {
+ CreateRegisteredPackageRepositories();
+ IRecentPackageRepository recentRepository = registeredPackageRepositories.RecentPackageRepository;
+ packageManagementOptionsViewModel = new PackageManagementOptionsViewModel(recentRepository);
+ }
+ return packageManagementOptionsViewModel;
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationExceptionEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationExceptionEventArgs.cs
new file mode 100644
index 0000000000..74442bc0ed
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationExceptionEventArgs.cs
@@ -0,0 +1,42 @@
+//
+// PackageOperationExceptionEventArgs.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageOperationExceptionEventArgs : EventArgs
+ {
+ public PackageOperationExceptionEventArgs(Exception ex)
+ {
+ Exception = ex;
+ }
+
+ public Exception Exception { get; private set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessage.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessage.cs
new file mode 100644
index 0000000000..73f0ffafa3
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessage.cs
@@ -0,0 +1,56 @@
+//
+// PackageOperationMessage.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageOperationMessage
+ {
+ string message;
+ object[] args;
+
+ public PackageOperationMessage(
+ MessageLevel level,
+ string message,
+ params object[] args)
+ {
+ this.Level = level;
+ this.message = message;
+ this.args = args;
+ }
+
+ public MessageLevel Level { get; private set; }
+
+ public override string ToString()
+ {
+ return String.Format(message, args);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessageLoggedEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessageLoggedEventArgs.cs
new file mode 100644
index 0000000000..0b8c984458
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessageLoggedEventArgs.cs
@@ -0,0 +1,46 @@
+//
+// PackageOperationMessageLoggedEventArgs.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageOperationMessageLoggedEventArgs : EventArgs
+ {
+ public PackageOperationMessageLoggedEventArgs(
+ MessageLevel level,
+ string message,
+ params object[] args)
+ {
+ this.Message = new PackageOperationMessage(level, message, args);
+ }
+
+ public PackageOperationMessage Message { get; private set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationsResolverFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationsResolverFactory.cs
new file mode 100644
index 0000000000..742df08d25
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationsResolverFactory.cs
@@ -0,0 +1,62 @@
+//
+// PackageOperationsResolverFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageOperationsResolverFactory : IPackageOperationResolverFactory
+ {
+ public IPackageOperationResolver CreateInstallPackageOperationResolver(
+ IPackageRepository localRepository,
+ IPackageRepository sourceRepository,
+ ILogger logger,
+ InstallPackageAction installAction)
+ {
+ return new InstallWalker(
+ localRepository,
+ sourceRepository,
+ null,
+ logger,
+ installAction.IgnoreDependencies,
+ installAction.AllowPrereleaseVersions);
+ }
+
+ public IPackageOperationResolver CreateUpdatePackageOperationResolver(IPackageRepository localRepository, IPackageRepository sourceRepository, ILogger logger, IUpdatePackageSettings settings)
+ {
+ return new InstallWalker(
+ localRepository,
+ sourceRepository,
+ null,
+ logger,
+ !settings.UpdateDependencies,
+ settings.AllowPrereleaseVersions);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryCache.cs
new file mode 100644
index 0000000000..9f5dbf646d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryCache.cs
@@ -0,0 +1,150 @@
+//
+// PackageRepositoryCache.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageRepositoryCache : IPackageRepositoryCache, IPackageRepositoryFactoryEvents
+ {
+ ISharpDevelopPackageRepositoryFactory factory;
+ RegisteredPackageSources registeredPackageSources;
+ IList<RecentPackageInfo> recentPackages;
+ IRecentPackageRepository recentPackageRepository;
+ ConcurrentDictionary<string, IPackageRepository> repositories =
+ new ConcurrentDictionary<string, IPackageRepository>();
+
+ public PackageRepositoryCache(
+ ISharpDevelopPackageRepositoryFactory factory,
+ RegisteredPackageSources registeredPackageSources,
+ IList<RecentPackageInfo> recentPackages)
+ {
+ this.factory = factory;
+ this.registeredPackageSources = registeredPackageSources;
+ this.recentPackages = recentPackages;
+ }
+
+ public PackageRepositoryCache(
+ RegisteredPackageSources registeredPackageSources,
+ IList<RecentPackageInfo> recentPackages)
+ : this(
+ new SharpDevelopPackageRepositoryFactory(),
+ registeredPackageSources,
+ recentPackages)
+ {
+ }
+
+ public event EventHandler<PackageRepositoryFactoryEventArgs> RepositoryCreated;
+
+ public IPackageRepository CreateRepository(string packageSource)
+ {
+ IPackageRepository repository = GetExistingRepository(packageSource);
+ if (repository != null) {
+ return repository;
+ }
+ return CreateNewCachedRepository(packageSource);
+ }
+
+ IPackageRepository GetExistingRepository(string packageSource)
+ {
+ IPackageRepository repository = null;
+ if (repositories.TryGetValue(packageSource, out repository)) {
+ return repository;
+ }
+ return null;
+ }
+
+ IPackageRepository CreateNewCachedRepository(string packageSource)
+ {
+ IPackageRepository repository = factory.CreateRepository(packageSource);
+ repositories.TryAdd(packageSource, repository);
+
+ OnPackageRepositoryCreated(repository);
+
+ return repository;
+ }
+
+ void OnPackageRepositoryCreated(IPackageRepository repository)
+ {
+ if (RepositoryCreated != null) {
+ RepositoryCreated(this, new PackageRepositoryFactoryEventArgs(repository));
+ }
+ }
+
+ public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem, IFileSystem configSettingsFileSystem)
+ {
+ return factory.CreateSharedRepository(pathResolver, fileSystem, configSettingsFileSystem);
+ }
+
+ public IPackageRepository CreateAggregateRepository()
+ {
+ IEnumerable<IPackageRepository> allRepositories = CreateAllEnabledRepositories();
+ return CreateAggregateRepository(allRepositories);
+ }
+
+ IEnumerable<IPackageRepository> CreateAllEnabledRepositories()
+ {
+ foreach (PackageSource source in registeredPackageSources.GetEnabledPackageSources()) {
+ yield return CreateRepository(source.Source);
+ }
+ }
+
+ public IPackageRepository CreateAggregateRepository(IEnumerable<IPackageRepository> repositories)
+ {
+ return factory.CreateAggregateRepository(repositories);
+ }
+
+ public IRecentPackageRepository RecentPackageRepository {
+ get {
+ CreateRecentPackageRepository();
+ return recentPackageRepository;
+ }
+ }
+
+ void CreateRecentPackageRepository()
+ {
+ if (recentPackageRepository == null) {
+ IPackageRepository aggregateRepository = CreateAggregateRepository();
+ CreateRecentPackageRepository(recentPackages, aggregateRepository);
+ }
+ }
+
+ public IRecentPackageRepository CreateRecentPackageRepository(
+ IList<RecentPackageInfo> recentPackages,
+ IPackageRepository aggregateRepository)
+ {
+ if (recentPackageRepository == null) {
+ recentPackageRepository = factory.CreateRecentPackageRepository(recentPackages, aggregateRepository);
+ }
+ return recentPackageRepository;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryFactoryEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryFactoryEventArgs.cs
new file mode 100644
index 0000000000..0415c048e0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryFactoryEventArgs.cs
@@ -0,0 +1,43 @@
+//
+// PackageRepositoryFactoryEventArgs.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageRepositoryFactoryEventArgs : EventArgs
+ {
+ public PackageRepositoryFactoryEventArgs(IPackageRepository repository)
+ {
+ this.Repository = repository;
+ }
+
+ public IPackageRepository Repository { get; private set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceConverter.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceConverter.cs
new file mode 100644
index 0000000000..9b37f47f60
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceConverter.cs
@@ -0,0 +1,84 @@
+//
+// PackageSourceConverter.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class PackageSourceConverter
+ {
+ public static IEnumerable<PackageSource> ConvertFromKeyValuePairs(IEnumerable<KeyValuePair<string, string>> packageSources)
+ {
+ if (HasAny(packageSources)) {
+ foreach (KeyValuePair<string, string> packageSource in packageSources) {
+ yield return CreatePackageSourceFromKeyValuePair(packageSource);
+ }
+ }
+ }
+
+ static bool HasAny(IEnumerable<KeyValuePair<string, string>> packageSources)
+ {
+ if (packageSources != null) {
+ return packageSources.Any();
+ }
+ return false;
+ }
+
+ static PackageSource CreatePackageSourceFromKeyValuePair(KeyValuePair<string, string> savedPackageSource)
+ {
+ string source = savedPackageSource.Value;
+ string name = savedPackageSource.Key;
+ return new PackageSource(source, name);
+ }
+
+ public static PackageSource ConvertFromFirstKeyValuePair(IEnumerable<KeyValuePair<string, string>> packageSources)
+ {
+ if (HasAny(packageSources)) {
+ return CreatePackageSourceFromKeyValuePair(packageSources.First());
+ }
+ return null;
+ }
+
+ public static IList<KeyValuePair<string, string>> ConvertToKeyValuePairList(IEnumerable<PackageSource> packageSources)
+ {
+ var convertedPackageSources = new List<KeyValuePair<string, string>>();
+ foreach (PackageSource source in packageSources) {
+ convertedPackageSources.Add(ConvertToKeyValuePair(source));
+ }
+ return convertedPackageSources;
+ }
+
+ public static KeyValuePair<string, string> ConvertToKeyValuePair(PackageSource source)
+ {
+ return new KeyValuePair<string, string>(source.Name, source.Source);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceExtensions.cs
new file mode 100644
index 0000000000..565f2fac46
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceExtensions.cs
@@ -0,0 +1,41 @@
+//
+// PackageSourceExtensions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class PackageSourceExtensions
+ {
+ public static bool IsAggregate(this PackageSource packageSource)
+ {
+ return packageSource.Source == RegisteredPackageSourceSettings.AggregatePackageSource.Source;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModel.cs
new file mode 100644
index 0000000000..e287daa1f1
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModel.cs
@@ -0,0 +1,63 @@
+//
+// PackageSourceViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageSourceViewModel : ViewModelBase<PackageSourceViewModel>
+ {
+ RegisteredPackageSource packageSource;
+
+ public PackageSourceViewModel(PackageSource packageSource)
+ {
+ this.packageSource = new RegisteredPackageSource(packageSource);
+ }
+
+ public PackageSource GetPackageSource()
+ {
+ return packageSource.ToPackageSource();
+ }
+
+ public string Name {
+ get { return packageSource.Name; }
+ set { packageSource.Name = value; }
+ }
+
+ public string SourceUrl {
+ get { return packageSource.Source; }
+ set { packageSource.Source = value; }
+ }
+
+ public bool IsEnabled {
+ get { return packageSource.IsEnabled; }
+ set { packageSource.IsEnabled = value; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModel.cs
new file mode 100644
index 0000000000..c8d73b37ab
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModel.cs
@@ -0,0 +1,539 @@
+//
+// PackageViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageViewModel : ViewModelBase<PackageViewModel>
+ {
+ DelegateCommand addPackageCommand;
+ DelegateCommand removePackageCommand;
+ DelegateCommand managePackageCommand;
+
+ PackageManagementSelectedProjects selectedProjects;
+ IPackageManagementEvents packageManagementEvents;
+ IPackageFromRepository package;
+ IEnumerable<PackageOperation> packageOperations = new PackageOperation[0];
+ PackageViewModelOperationLogger logger;
+ IPackageActionRunner actionRunner;
+ IPackageViewModelParent parent;
+
+ public PackageViewModel(
+ IPackageViewModelParent parent,
+ IPackageFromRepository package,
+ PackageManagementSelectedProjects selectedProjects,
+ IPackageManagementEvents packageManagementEvents,
+ IPackageActionRunner actionRunner,
+ ILogger logger)
+ {
+ this.parent = parent;
+ this.package = package;
+ this.selectedProjects = selectedProjects;
+ this.packageManagementEvents = packageManagementEvents;
+ this.actionRunner = actionRunner;
+ this.logger = CreateLogger(logger);
+
+ CreateCommands();
+ }
+
+ public IPackageViewModelParent GetParent()
+ {
+ return parent;
+ }
+
+ protected virtual PackageViewModelOperationLogger CreateLogger(ILogger logger)
+ {
+ return new PackageViewModelOperationLogger(logger, package);
+ }
+
+ void CreateCommands()
+ {
+ addPackageCommand = new DelegateCommand(param => AddPackage());
+ removePackageCommand = new DelegateCommand(param => RemovePackage());
+ managePackageCommand = new DelegateCommand(param => ManagePackage());
+ }
+
+ public ICommand AddPackageCommand {
+ get { return addPackageCommand; }
+ }
+
+ public ICommand RemovePackageCommand {
+ get { return removePackageCommand; }
+ }
+
+ public ICommand ManagePackageCommand {
+ get { return managePackageCommand; }
+ }
+
+ public IPackage GetPackage()
+ {
+ return package;
+ }
+
+ public bool HasLicenseUrl {
+ get { return LicenseUrl != null; }
+ }
+
+ public Uri LicenseUrl {
+ get { return package.LicenseUrl; }
+ }
+
+ public bool HasProjectUrl {
+ get { return ProjectUrl != null; }
+ }
+
+ public Uri ProjectUrl {
+ get { return package.ProjectUrl; }
+ }
+
+ public bool HasReportAbuseUrl {
+ get { return ReportAbuseUrl != null; }
+ }
+
+ public Uri ReportAbuseUrl {
+ get { return package.ReportAbuseUrl; }
+ }
+
+ public bool IsAdded {
+ get { return IsPackageInstalled(); }
+ }
+
+ bool IsPackageInstalled()
+ {
+ return selectedProjects.IsPackageInstalled(package);
+ }
+
+ public IEnumerable<PackageDependencySet> Dependencies {
+ get { return package.DependencySets; }
+ }
+
+ public bool HasDependencies {
+ get { return package.HasDependencies; }
+ }
+
+ public bool HasNoDependencies {
+ get { return !HasDependencies; }
+ }
+
+ public IEnumerable<string> Authors {
+ get { return package.Authors; }
+ }
+
+ public bool HasDownloadCount {
+ get { return package.DownloadCount >= 0; }
+ }
+
+ public string Id {
+ get { return package.Id; }
+ }
+
+ public string Name {
+ get { return package.GetName(); }
+ }
+
+ public bool HasGalleryUrl {
+ get { return GalleryUrl != null; }
+ }
+
+ public bool HasNoGalleryUrl {
+ get { return !HasGalleryUrl; }
+ }
+
+ public Uri GalleryUrl {
+ get { return package.GalleryUrl; }
+ }
+
+ public Uri IconUrl {
+ get { return package.IconUrl; }
+ }
+
+ public string Summary {
+ get { return package.SummaryOrDescription(); }
+ }
+
+ public SemanticVersion Version {
+ get { return package.Version; }
+ }
+
+ public int DownloadCount {
+ get { return package.DownloadCount; }
+ }
+
+ public string Description {
+ get { return package.Description; }
+ }
+
+ public DateTimeOffset? LastPublished {
+ get { return package.Published; }
+ }
+
+ public bool HasLastPublished {
+ get { return package.Published.HasValue; }
+ }
+
+ public void AddPackage()
+ {
+ ClearReportedMessages();
+ logger.LogAddingPackage();
+
+ using (IDisposable operation = StartInstallOperation(package)) {
+ TryInstallingPackage();
+ }
+
+ logger.LogAfterPackageOperationCompletes();
+ }
+
+ protected virtual IDisposable StartInstallOperation(IPackageFromRepository package)
+ {
+ return package.StartInstallOperation();
+ }
+
+ void ClearReportedMessages()
+ {
+ packageManagementEvents.OnPackageOperationsStarting();
+ }
+
+ void GetPackageOperations()
+ {
+ IPackageManagementProject project = GetSingleProjectSelected();
+ project.Logger = logger;
+ InstallPackageAction installAction = project.CreateInstallPackageAction();
+ installAction.AllowPrereleaseVersions = parent.IncludePrerelease;
+ packageOperations = project.GetInstallPackageOperations(package, installAction);
+ }
+
+ IPackageManagementProject GetSingleProjectSelected()
+ {
+ return selectedProjects.GetSingleProjectSelected(package.Repository);
+ }
+
+ bool CanInstallPackage()
+ {
+ IEnumerable<IPackage> packages = GetPackagesRequiringLicenseAcceptance();
+ if (packages.Any()) {
+ return packageManagementEvents.OnAcceptLicenses(packages);
+ }
+ return true;
+ }
+
+ IEnumerable<IPackage> GetPackagesRequiringLicenseAcceptance()
+ {
+ IList<IPackage> packagesToBeInstalled = GetPackagesToBeInstalled();
+ return GetPackagesRequiringLicenseAcceptance(packagesToBeInstalled);
+ }
+
+ IEnumerable<IPackage> GetPackagesRequiringLicenseAcceptance(IList<IPackage> packagesToBeInstalled)
+ {
+ return packagesToBeInstalled.Where(package => PackageRequiresLicenseAcceptance(package));
+ }
+
+ IList<IPackage> GetPackagesToBeInstalled()
+ {
+ List<IPackage> packages = new List<IPackage>();
+ foreach (PackageOperation operation in packageOperations) {
+ if (operation.Action == PackageAction.Install) {
+ packages.Add(operation.Package);
+ }
+ }
+ return packages;
+ }
+
+ bool PackageRequiresLicenseAcceptance(IPackage package)
+ {
+ return package.RequireLicenseAcceptance && !IsPackageInstalledInSolution(package);
+ }
+
+ bool IsPackageInstalledInSolution(IPackage package)
+ {
+ return selectedProjects.IsPackageInstalledInSolution(package);
+ }
+
+ void TryInstallingPackage()
+ {
+ try {
+ GetPackageOperations();
+ if (CanInstallPackage()) {
+ InstallPackage();
+ }
+ } catch (Exception ex) {
+ ReportError(ex);
+ logger.LogError(ex);
+ }
+ }
+
+ void InstallPackage()
+ {
+ InstallPackage(packageOperations);
+ OnPropertyChanged(model => model.IsAdded);
+ }
+
+ void InstallPackage(IEnumerable<PackageOperation> packageOperations)
+ {
+ IPackageManagementProject project = GetSingleProjectSelected();
+ ProcessPackageOperationsAction action = CreateInstallPackageAction(project);
+ action.AllowPrereleaseVersions = parent.IncludePrerelease;
+ action.Package = package;
+ action.Operations = packageOperations;
+ actionRunner.Run(action);
+ }
+
+ protected virtual ProcessPackageOperationsAction CreateInstallPackageAction(
+ IPackageManagementProject project)
+ {
+ return project.CreateInstallPackageAction();
+ }
+
+ void ReportError(Exception ex)
+ {
+ packageManagementEvents.OnPackageOperationError(ex);
+ }
+
+ public void RemovePackage()
+ {
+ ClearReportedMessages();
+ logger.LogRemovingPackage();
+ TryUninstallingPackage();
+ logger.LogAfterPackageOperationCompletes();
+
+ OnPropertyChanged(model => model.IsAdded);
+ }
+
+ void LogRemovingPackage()
+ {
+ logger.LogRemovingPackage();
+ }
+
+ void TryUninstallingPackage()
+ {
+ try {
+ IPackageManagementProject project = GetSingleProjectSelected();
+ UninstallPackageAction action = project.CreateUninstallPackageAction();
+ action.Package = package;
+ actionRunner.Run(action);
+ } catch (Exception ex) {
+ ReportError(ex);
+ logger.LogError(ex);
+ }
+ }
+
+ public bool IsManaged {
+ get {
+ if (selectedProjects.HasMultipleProjects()) {
+ return true;
+ }
+ return !selectedProjects.HasSingleProjectSelected();
+ }
+ }
+
+ public void ManagePackage()
+ {
+ List<IPackageManagementSelectedProject> projects = GetSelectedProjectsForPackage();
+ if (packageManagementEvents.OnSelectProjects(projects)) {
+ ManagePackagesForSelectedProjects(projects);
+ }
+ }
+
+ List<IPackageManagementSelectedProject> GetSelectedProjectsForPackage()
+ {
+ return selectedProjects.GetProjects(package).ToList();
+ }
+
+ public void ManagePackagesForSelectedProjects(IEnumerable<IPackageManagementSelectedProject> projects)
+ {
+ ManagePackagesForSelectedProjects(projects.ToList());
+ }
+
+ void ManagePackagesForSelectedProjects(IList<IPackageManagementSelectedProject> projects)
+ {
+ ClearReportedMessages();
+ logger.LogManagingPackage();
+
+ using (IDisposable operation = StartInstallOperation(package)) {
+ TryInstallingPackagesForSelectedProjects(projects);
+ }
+
+ logger.LogAfterPackageOperationCompletes();
+ OnPropertyChanged(model => model.IsAdded);
+ }
+
+ void TryInstallingPackagesForSelectedProjects(IList<IPackageManagementSelectedProject> projects)
+ {
+ try {
+ if (AnyProjectsSelected(projects)) {
+ InstallPackagesForSelectedProjects(projects);
+ }
+ } catch (Exception ex) {
+ ReportError(ex);
+ logger.LogError(ex);
+ }
+ }
+
+ protected virtual bool AnyProjectsSelected(IList<IPackageManagementSelectedProject> projects)
+ {
+ return projects.Any(project => project.IsSelected);
+ }
+
+ void InstallPackagesForSelectedProjects(IList<IPackageManagementSelectedProject> projects)
+ {
+ if (CanInstallPackage(projects)) {
+ IList<ProcessPackageAction> actions = GetProcessPackageActionsForSelectedProjects(projects);
+ RunActionsIfAnyExist(actions);
+ }
+ }
+
+ public virtual IList<ProcessPackageAction> GetProcessPackageActionsForSelectedProjects(
+ IList<IPackageManagementSelectedProject> selectedProjects)
+ {
+ var actions = new List<ProcessPackageAction>();
+ foreach (IPackageManagementSelectedProject selectedProject in selectedProjects) {
+ if (selectedProject.IsSelected) {
+ ProcessPackageAction action = CreateInstallPackageAction(selectedProject);
+ action.AllowPrereleaseVersions = parent.IncludePrerelease;
+ actions.Add(action);
+ }
+ }
+ return actions;
+ }
+
+ bool CanInstallPackage(IList<IPackageManagementSelectedProject> projects)
+ {
+ IPackageManagementSelectedProject project = projects.FirstOrDefault();
+ if (project != null) {
+ return CanInstallPackage(project);
+ }
+ return false;
+ }
+
+ bool CanInstallPackage(IPackageManagementSelectedProject selectedProject)
+ {
+ IEnumerable<IPackage> licensedPackages = GetPackagesRequiringLicenseAcceptance(selectedProject);
+ if (licensedPackages.Any()) {
+ return packageManagementEvents.OnAcceptLicenses(licensedPackages);
+ }
+ return true;
+ }
+
+ protected ProcessPackageAction CreateInstallPackageAction(IPackageManagementSelectedProject selectedProject)
+ {
+ IPackageManagementProject project = selectedProject.Project;
+ project.Logger = logger;
+
+ ProcessPackageOperationsAction action = CreateInstallPackageAction(project);
+ action.Package = package;
+ return action;
+ }
+
+ protected ProcessPackageAction CreateUninstallPackageAction(IPackageManagementSelectedProject selectedProject)
+ {
+ IPackageManagementProject project = selectedProject.Project;
+ project.Logger = logger;
+
+ ProcessPackageAction action = project.CreateUninstallPackageAction();
+ action.Package = package;
+ return action;
+ }
+
+ void RunActionsIfAnyExist(IList<ProcessPackageAction> actions)
+ {
+ if (actions.Any()) {
+ actionRunner.Run(actions);
+ }
+ }
+
+ IEnumerable<IPackage> GetPackagesRequiringLicenseAcceptance(IPackageManagementSelectedProject selectedProject)
+ {
+ IPackageManagementProject project = selectedProject.Project;
+ project.Logger = logger;
+ InstallPackageAction installAction = project.CreateInstallPackageAction();
+ installAction.AllowPrereleaseVersions = parent.IncludePrerelease;
+ IEnumerable<PackageOperation> operations = project.GetInstallPackageOperations(package, installAction);
+ return GetPackagesRequiringLicenseAcceptance(operations);
+ }
+
+ IEnumerable<IPackage> GetPackagesRequiringLicenseAcceptance(IEnumerable<PackageOperation> operations)
+ {
+ foreach (PackageOperation operation in operations) {
+ if (PackageOperationRequiresLicenseAcceptance(operation)) {
+ yield return operation.Package;
+ }
+ }
+ }
+
+ bool PackageOperationRequiresLicenseAcceptance(PackageOperation operation)
+ {
+ return
+ (operation.Action == PackageAction.Install) &&
+ operation.Package.RequireLicenseAcceptance &&
+ !IsPackageInstalledInSolution(operation.Package);
+ }
+
+ static readonly string DisplayTextMarkupFormat = "<span weight='bold'>{0}</span>\n{1}";
+
+ public string GetDisplayTextMarkup ()
+ {
+ return MarkupString.Format (DisplayTextMarkupFormat, Name, Summary);
+ }
+
+ public string GetAuthors()
+ {
+ return String.Join (", ", Authors);
+ }
+
+ public string GetLastPublishedDisplayText()
+ {
+ if (HasLastPublished) {
+ return LastPublished.Value.Date.ToShortDateString ();
+ }
+ return String.Empty;
+ }
+
+ public string GetDownloadCountDisplayText()
+ {
+ if (HasDownloadCount) {
+ return DownloadCount.ToString ();
+ }
+ return String.Empty;
+ }
+
+ public string GetPackageDependenciesDisplayText ()
+ {
+ var displayText = new StringBuilder ();
+ foreach (PackageDependencySet dependencySet in Dependencies) {
+ foreach (PackageDependency dependency in dependencySet.Dependencies) {
+ displayText.AppendLine (dependency.ToString ());
+ }
+ }
+ return displayText.ToString ();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelFactory.cs
new file mode 100644
index 0000000000..89c42b6557
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelFactory.cs
@@ -0,0 +1,73 @@
+//
+// PackageViewModelFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageViewModelFactory : IPackageViewModelFactory
+ {
+ public PackageViewModelFactory(IPackageViewModelFactory packageViewModelFactory)
+ : this(
+ packageViewModelFactory.Solution,
+ packageViewModelFactory.PackageManagementEvents,
+ packageViewModelFactory.PackageActionRunner)
+ {
+ }
+
+ public PackageViewModelFactory(
+ IPackageManagementSolution solution,
+ IPackageManagementEvents packageManagementEvents,
+ IPackageActionRunner actionRunner)
+ {
+ this.Solution = solution;
+ this.SelectedProjects = new PackageManagementSelectedProjects(solution);
+ this.PackageManagementEvents = packageManagementEvents;
+ this.PackageActionRunner = actionRunner;
+ this.Logger = new PackageManagementLogger(packageManagementEvents);
+ }
+
+ public virtual PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
+ {
+ return new PackageViewModel(
+ parent,
+ package,
+ SelectedProjects,
+ PackageManagementEvents,
+ PackageActionRunner,
+ Logger);
+ }
+
+ public IPackageManagementSolution Solution { get; private set; }
+ public PackageManagementSelectedProjects SelectedProjects { get; protected set; }
+ public IPackageManagementEvents PackageManagementEvents { get; private set; }
+ public ILogger Logger { get; private set; }
+ public IPackageActionRunner PackageActionRunner { get; private set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs
new file mode 100644
index 0000000000..40cadd6c90
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageViewModelOperationLogger.cs
@@ -0,0 +1,124 @@
+//
+// PackageViewModelOperationLogger.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackageViewModelOperationLogger : ILogger
+ {
+ ILogger logger;
+ IPackage package;
+
+ public PackageViewModelOperationLogger(ILogger logger, IPackage package)
+ {
+ this.logger = logger;
+ this.package = package;
+
+ GetMessageFormats();
+ }
+
+ void GetMessageFormats()
+ {
+ AddingPackageMessageFormat = "Installing...{0}";
+ RemovingPackageMessageFormat = "Uninstalling...{0}";
+ ManagingPackageMessageFormat = "Managing...{0}";
+ }
+
+ public string AddingPackageMessageFormat { get; set; }
+ public string RemovingPackageMessageFormat { get; set; }
+ public string ManagingPackageMessageFormat { get; set; }
+
+ public void Log(MessageLevel level, string message, params object[] args)
+ {
+ logger.Log(level, message, args);
+ }
+
+ public void LogInformation(string message)
+ {
+ Log(MessageLevel.Info, message);
+ }
+
+ public void LogAfterPackageOperationCompletes()
+ {
+ LogEndMarkerLine();
+ LogEmptyLine();
+ }
+
+ void LogEndMarkerLine()
+ {
+ string message = new String('=', 30);
+ LogInformation(message);
+ }
+
+ void LogEmptyLine()
+ {
+ LogInformation(String.Empty);
+ }
+
+ public void LogAddingPackage()
+ {
+ string message = GetFormattedStartPackageOperationMessage(AddingPackageMessageFormat);
+ LogInformation(message);
+ }
+
+ string GetFormattedStartPackageOperationMessage(string format)
+ {
+ string message = String.Format(format, package.ToString());
+ return GetStartPackageOperationMessage(message);
+ }
+
+ string GetStartPackageOperationMessage(string message)
+ {
+ return String.Format("------- {0} -------", message);
+ }
+
+ public void LogRemovingPackage()
+ {
+ string message = GetFormattedStartPackageOperationMessage(RemovingPackageMessageFormat);
+ LogInformation(message);
+ }
+
+ public void LogError(Exception ex)
+ {
+ LogInformation(ex.ToString());
+ }
+
+ public void LogManagingPackage()
+ {
+ string message = GetFormattedStartPackageOperationMessage(ManagingPackageMessageFormat);
+ LogInformation(message);
+ }
+
+ public FileConflictResolution ResolveFileConflict(string message)
+ {
+ return logger.ResolveFileConflict(message);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageResult.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageResult.cs
new file mode 100644
index 0000000000..7b64769b75
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageResult.cs
@@ -0,0 +1,50 @@
+//
+// PackagesForSelectedPageResult.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackagesForSelectedPageResult
+ {
+ public PackagesForSelectedPageResult(IEnumerable<IPackage> packages, int totalPackages)
+ {
+ this.Packages = packages;
+ this.TotalPackagesOnPage = packages.Count();
+ this.TotalPackages = totalPackages;
+ }
+
+ public IEnumerable<IPackage> Packages { get; set; }
+ public int TotalPackagesOnPage { get; set; }
+ public int TotalPackages { get; set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModel.cs
new file mode 100644
index 0000000000..b735f9aea5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModel.cs
@@ -0,0 +1,447 @@
+//
+// PackagesViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.Linq;
+using System.Text;
+
+using MonoDevelop.Core;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public abstract class PackagesViewModel : ViewModelBase<PackagesViewModel>, IDisposable, IPackageViewModelParent
+ {
+ Pages pages = new Pages();
+
+ IRegisteredPackageRepositories registeredPackageRepositories;
+ IPackageViewModelFactory packageViewModelFactory;
+ ITaskFactory taskFactory;
+ IEnumerable<IPackage> allPackages;
+ ITask<PackagesForSelectedPageResult> task;
+ bool includePrerelease;
+
+ public PackagesViewModel(
+ IRegisteredPackageRepositories registeredPackageRepositories,
+ IPackageViewModelFactory packageViewModelFactory,
+ ITaskFactory taskFactory)
+ {
+ this.registeredPackageRepositories = registeredPackageRepositories;
+ this.packageViewModelFactory = packageViewModelFactory;
+ this.taskFactory = taskFactory;
+
+ PackageViewModels = new ObservableCollection<PackageViewModel>();
+ ErrorMessage = String.Empty;
+
+ CreateCommands();
+ }
+
+ void CreateCommands()
+ {
+ ShowNextPageCommand = new DelegateCommand(param => ShowNextPage());
+ ShowPreviousPageCommand = new DelegateCommand(param => ShowPreviousPage());
+ ShowPageCommand = new DelegateCommand(param => ExecuteShowPageCommand(param));
+ SearchCommand = new DelegateCommand(param => Search());
+ UpdateAllPackagesCommand = new DelegateCommand(param => UpdateAllPackages());
+ }
+
+ public ICommand ShowNextPageCommand { get; private set; }
+ public ICommand ShowPreviousPageCommand { get; private set; }
+ public ICommand ShowPageCommand { get; private set; }
+ public ICommand SearchCommand { get; private set; }
+ public ICommand UpdateAllPackagesCommand { get; private set; }
+
+ public void Dispose()
+ {
+ OnDispose();
+ IsDisposed = true;
+ }
+
+ protected virtual void OnDispose()
+ {
+ }
+
+ public bool IsDisposed { get; private set; }
+
+ public bool HasError { get; private set; }
+ public string ErrorMessage { get; private set; }
+
+ public ObservableCollection<PackageViewModel> PackageViewModels { get; set; }
+
+ public IRegisteredPackageRepositories RegisteredPackageRepositories {
+ get { return registeredPackageRepositories; }
+ }
+
+ public bool IsReadingPackages { get; private set; }
+
+ public void ReadPackages()
+ {
+ allPackages = null;
+ pages.SelectedPageNumber = 1;
+ UpdateRepositoryBeforeReadPackagesTaskStarts();
+ StartReadPackagesTask();
+ }
+
+ void StartReadPackagesTask()
+ {
+ IsReadingPackages = true;
+ HasError = false;
+ ClearPackages();
+ CancelReadPackagesTask();
+ CreateReadPackagesTask();
+ task.Start();
+ }
+
+ protected virtual void UpdateRepositoryBeforeReadPackagesTaskStarts()
+ {
+ }
+
+ void CancelReadPackagesTask()
+ {
+ if (task != null) {
+ task.Cancel();
+ }
+ }
+
+ void CreateReadPackagesTask()
+ {
+ task = taskFactory.CreateTask(
+ () => GetPackagesForSelectedPageResult(),
+ (result) => OnPackagesReadForSelectedPage(result));
+ }
+
+ PackagesForSelectedPageResult GetPackagesForSelectedPageResult()
+ {
+ IEnumerable<IPackage> packages = GetPackagesForSelectedPage();
+ return new PackagesForSelectedPageResult(packages, TotalItems);
+ }
+
+ void OnPackagesReadForSelectedPage(ITask<PackagesForSelectedPageResult> task)
+ {
+ IsReadingPackages = false;
+ if (task.IsFaulted) {
+ SaveError(task.Exception);
+ } else if (task.IsCancelled) {
+ // Ignore
+ } else {
+ UpdatePackagesForSelectedPage(task.Result);
+ }
+ base.OnPropertyChanged(null);
+ }
+
+ void SaveError(AggregateException ex)
+ {
+ HasError = true;
+ ErrorMessage = GetErrorMessage(ex);
+ LoggingService.LogDebug("PackagesViewModel error", ex);
+ }
+
+ string GetErrorMessage(AggregateException ex)
+ {
+ var errorMessage = new AggregateExceptionErrorMessage(ex);
+ return errorMessage.ToString();
+ }
+
+ void UpdatePackagesForSelectedPage(PackagesForSelectedPageResult result)
+ {
+ pages.TotalItems = result.TotalPackages;
+ pages.TotalItemsOnSelectedPage = result.TotalPackagesOnPage;
+ UpdatePackageViewModels(result.Packages);
+ }
+
+ void PagesChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ StartReadPackagesTask();
+ base.OnPropertyChanged(null);
+ }
+
+ IEnumerable<IPackage> GetPackagesForSelectedPage()
+ {
+ IEnumerable<IPackage> filteredPackages = GetFilteredPackagesBeforePagingResults();
+ return GetPackagesForSelectedPage(filteredPackages);
+ }
+
+ IEnumerable<IPackage> GetFilteredPackagesBeforePagingResults()
+ {
+ if (allPackages == null) {
+ IQueryable<IPackage> packages = GetPackagesFromPackageSource();
+ TotalItems = packages.Count();
+ allPackages = GetFilteredPackagesBeforePagingResults(packages);
+ }
+ return allPackages;
+ }
+
+ /// <summary>
+ /// Returns the queryable object that will be used to query the NuGet online feed.
+ /// </summary>
+ public IQueryable<IPackage> GetPackagesFromPackageSource()
+ {
+ IQueryable<IPackage> packages = GetAllPackages();
+ packages = OrderPackages(packages);
+ return FilterPackagesBySearchCriteria(packages);
+ }
+
+ protected virtual IQueryable<IPackage> OrderPackages(IQueryable<IPackage> packages)
+ {
+ return packages
+ .OrderBy(package => package.Id);
+ }
+
+ IQueryable<IPackage> FilterPackagesBySearchCriteria(IQueryable<IPackage> packages)
+ {
+ string searchCriteria = GetSearchCriteria();
+ return FilterPackagesBySearchCriteria(packages, searchCriteria);
+ }
+
+ string GetSearchCriteria()
+ {
+ if (String.IsNullOrWhiteSpace(SearchTerms)) {
+ return null;
+ }
+ return SearchTerms;
+ }
+
+ protected virtual IQueryable<IPackage> FilterPackagesBySearchCriteria(IQueryable<IPackage> packages, string searchCriteria)
+ {
+ return packages.Find(searchCriteria);
+ }
+
+ IEnumerable<IPackage> GetPackagesForSelectedPage(IEnumerable<IPackage> allPackages)
+ {
+ int packagesToSkip = pages.ItemsBeforeFirstPage;
+ return allPackages
+ .Skip(packagesToSkip)
+ .Take(pages.PageSize);
+ }
+
+ /// <summary>
+ /// Returns all the packages.
+ /// </summary>
+ protected virtual IQueryable<IPackage> GetAllPackages()
+ {
+ return null;
+ }
+
+ /// <summary>
+ /// Allows filtering of the packages before paging the results. Call base class method
+ /// to run default filtering.
+ /// </summary>
+ protected virtual IEnumerable<IPackage> GetFilteredPackagesBeforePagingResults(IQueryable<IPackage> allPackages)
+ {
+ IEnumerable<IPackage> bufferedPackages = GetBufferedPackages(allPackages);
+ return bufferedPackages;
+ }
+
+ IEnumerable<IPackage> GetBufferedPackages(IQueryable<IPackage> allPackages)
+ {
+ return allPackages.AsBufferedEnumerable(30);
+ }
+
+ void UpdatePackageViewModels(IEnumerable<IPackage> packages)
+ {
+ IEnumerable<PackageViewModel> currentViewModels = ConvertToPackageViewModels(packages);
+ UpdatePackageViewModels(currentViewModels);
+ }
+
+ void UpdatePackageViewModels(IEnumerable<PackageViewModel> newPackageViewModels)
+ {
+ ClearPackages();
+ PackageViewModels.AddRange(newPackageViewModels);
+ }
+
+ void ClearPackages()
+ {
+ PackageViewModels.Clear();
+ }
+
+ public IEnumerable<PackageViewModel> ConvertToPackageViewModels(IEnumerable<IPackage> packages)
+ {
+ foreach (IPackage package in packages) {
+ yield return CreatePackageViewModel(package);
+ }
+ }
+
+ PackageViewModel CreatePackageViewModel(IPackage package)
+ {
+ var repository = registeredPackageRepositories.ActiveRepository;
+ var packageFromRepository = new PackageFromRepository(package, repository);
+ return packageViewModelFactory.CreatePackageViewModel(this, packageFromRepository);
+ }
+
+ public int SelectedPageNumber {
+ get { return pages.SelectedPageNumber; }
+ set {
+ if (pages.SelectedPageNumber != value) {
+ pages.SelectedPageNumber = value;
+ StartReadPackagesTask();
+ base.OnPropertyChanged(null);
+ }
+ }
+ }
+
+ public int PageSize {
+ get { return pages.PageSize; }
+ set { pages.PageSize = value; }
+ }
+
+ public bool IsPaged {
+ get { return pages.IsPaged; }
+ }
+
+ public ObservableCollection<Page> Pages {
+ get { return pages; }
+ }
+
+ public bool HasPreviousPage {
+ get { return pages.HasPreviousPage; }
+ }
+
+ public bool HasNextPage {
+ get { return pages.HasNextPage; }
+ }
+
+ public int MaximumSelectablePages {
+ get { return pages.MaximumSelectablePages; }
+ set { pages.MaximumSelectablePages = value; }
+ }
+
+ public int TotalItems { get; private set; }
+
+ public void ShowNextPage()
+ {
+ SelectedPageNumber += 1;
+ }
+
+ public void ShowPreviousPage()
+ {
+ SelectedPageNumber -= 1;
+ }
+
+ void ExecuteShowPageCommand(object param)
+ {
+ int pageNumber = (int)param;
+ ShowPage(pageNumber);
+ }
+
+ public void ShowPage(int pageNumber)
+ {
+ SelectedPageNumber = pageNumber;
+ }
+
+ public bool IsSearchable { get; set; }
+
+ public string SearchTerms { get; set; }
+
+ public void Search()
+ {
+ ReadPackages();
+ OnPropertyChanged(null);
+ }
+
+ public bool ShowPackageSources { get; set; }
+
+ public IEnumerable<PackageSource> PackageSources {
+ get {
+ foreach (PackageSource packageSource in registeredPackageRepositories.PackageSources.GetEnabledPackageSources()) {
+ yield return packageSource;
+ }
+ if (registeredPackageRepositories.PackageSources.HasMultipleEnabledPackageSources) {
+ yield return RegisteredPackageSourceSettings.AggregatePackageSource;
+ }
+ }
+ }
+
+ public PackageSource SelectedPackageSource {
+ get { return registeredPackageRepositories.ActivePackageSource; }
+ set {
+ if (registeredPackageRepositories.ActivePackageSource != value) {
+ registeredPackageRepositories.ActivePackageSource = value;
+ ReadPackages();
+ OnPropertyChanged(null);
+ }
+ }
+ }
+
+ public bool ShowUpdateAllPackages { get; set; }
+
+ public bool IsUpdateAllPackagesEnabled {
+ get {
+ return ShowUpdateAllPackages && (TotalItems > 1);
+ }
+ }
+
+ void UpdateAllPackages()
+ {
+ try {
+ packageViewModelFactory.PackageManagementEvents.OnPackageOperationsStarting();
+ TryUpdatingAllPackages();
+ } catch (Exception ex) {
+ ReportError(ex);
+ LogError(ex);
+ }
+ }
+
+ void LogError(Exception ex)
+ {
+ packageViewModelFactory
+ .Logger
+ .Log(MessageLevel.Error, ex.ToString());
+ }
+
+ void ReportError(Exception ex)
+ {
+ packageViewModelFactory
+ .PackageManagementEvents
+ .OnPackageOperationError(ex);
+ }
+
+ protected virtual void TryUpdatingAllPackages()
+ {
+ }
+
+ protected IPackageActionRunner ActionRunner {
+ get { return packageViewModelFactory.PackageActionRunner; }
+ }
+
+ public bool IncludePrerelease {
+ get { return includePrerelease; }
+ set {
+ if (includePrerelease != value) {
+ includePrerelease = value;
+ ReadPackages();
+ OnPropertyChanged(null);
+ }
+ }
+ }
+
+ public bool ShowPrerelease { get; set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModels.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModels.cs
new file mode 100644
index 0000000000..b64ddb2ca3
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesViewModels.cs
@@ -0,0 +1,73 @@
+//
+// PackagesViewModels.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class PackagesViewModels : IDisposable
+ {
+ public PackagesViewModels(
+ IPackageManagementSolution solution,
+ IRegisteredPackageRepositories registeredPackageRepositories,
+ IThreadSafePackageManagementEvents packageManagementEvents,
+ IPackageActionRunner actionRunner,
+ ITaskFactory taskFactory)
+ {
+ var packageViewModelFactory = new PackageViewModelFactory(solution, packageManagementEvents, actionRunner);
+ var updatedPackageViewModelFactory = new UpdatedPackageViewModelFactory(packageViewModelFactory);
+ var installedPackageViewModelFactory = new InstalledPackageViewModelFactory(packageViewModelFactory);
+
+ AvailablePackagesViewModel = new AvailablePackagesViewModel(registeredPackageRepositories, packageViewModelFactory, taskFactory);
+ InstalledPackagesViewModel = new InstalledPackagesViewModel(solution, packageManagementEvents, registeredPackageRepositories, installedPackageViewModelFactory, taskFactory);
+ UpdatedPackagesViewModel = new UpdatedPackagesViewModel(solution, registeredPackageRepositories, updatedPackageViewModelFactory, taskFactory);
+ RecentPackagesViewModel = new RecentPackagesViewModel(packageManagementEvents, registeredPackageRepositories, packageViewModelFactory, taskFactory);
+ }
+
+ public AvailablePackagesViewModel AvailablePackagesViewModel { get; private set; }
+ public InstalledPackagesViewModel InstalledPackagesViewModel { get; private set; }
+ public RecentPackagesViewModel RecentPackagesViewModel { get; private set; }
+ public UpdatedPackagesViewModel UpdatedPackagesViewModel { get; private set; }
+
+ public void ReadPackages()
+ {
+ AvailablePackagesViewModel.ReadPackages();
+ InstalledPackagesViewModel.ReadPackages();
+ UpdatedPackagesViewModel.ReadPackages();
+ RecentPackagesViewModel.ReadPackages();
+ }
+
+ public void Dispose()
+ {
+ AvailablePackagesViewModel.Dispose();
+ InstalledPackagesViewModel.Dispose();
+ RecentPackagesViewModel.Dispose();
+ UpdatedPackagesViewModel.Dispose();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Page.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Page.cs
new file mode 100644
index 0000000000..911f23f6c7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Page.cs
@@ -0,0 +1,43 @@
+//
+// Page.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class Page
+ {
+ public int Number { get; set; }
+ public bool IsSelected { get; set; }
+
+ public override string ToString()
+ {
+ return String.Format("[Page] Number={0}, IsSelected={1}", Number, IsSelected);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Pages.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Pages.cs
new file mode 100644
index 0000000000..ba542b5c8d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Pages.cs
@@ -0,0 +1,180 @@
+//
+// Pages.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class Pages : ObservableCollection<Page>
+ {
+ public const int DefaultPageSize = 10;
+ public const int DefaultMaximumSelectablePages = 5;
+
+ int pageSize = DefaultPageSize;
+ int selectedPageNumber = 1;
+ int maximumSelectablePages = DefaultMaximumSelectablePages;
+ int totalItems = 0;
+ int itemsOnSelectedPage = 0;
+
+ public int TotalItems {
+ get { return totalItems; }
+ set {
+ if (totalItems != value) {
+ totalItems = value;
+ UpdatePages();
+ }
+ }
+ }
+
+ public int SelectedPageNumber {
+ get { return selectedPageNumber; }
+ set {
+ if (selectedPageNumber != value) {
+ selectedPageNumber = value;
+ UpdatePages();
+ }
+ }
+ }
+
+ public int MaximumSelectablePages {
+ get { return maximumSelectablePages; }
+ set {
+ if (maximumSelectablePages != value) {
+ maximumSelectablePages = value;
+ UpdatePages();
+ }
+ }
+ }
+
+ public int ItemsBeforeFirstPage {
+ get {
+ return (selectedPageNumber - 1) * pageSize;
+ }
+ }
+
+ public bool IsPaged {
+ get { return totalItems > pageSize; }
+ }
+
+ public bool HasPreviousPage {
+ get { return IsPaged && !IsFirstPageSelected; }
+ }
+
+ bool IsFirstPageSelected {
+ get { return selectedPageNumber == 1; }
+ }
+
+ public bool HasNextPage {
+ get { return IsPaged && !IsLastPageSelected; }
+ }
+
+ bool IsLastPageSelected {
+ get { return selectedPageNumber == TotalPages; }
+ }
+
+ public int TotalPages {
+ get { return (totalItems + pageSize - 1) / pageSize; }
+ }
+
+ public int PageSize {
+ get { return pageSize; }
+ set {
+ if (pageSize != value) {
+ pageSize = value;
+ UpdatePages();
+ }
+ }
+ }
+
+ void UpdatePages()
+ {
+ Clear();
+
+ int startPage = GetStartPage();
+ for (int pageNumber = startPage; pageNumber <= TotalPages; ++pageNumber) {
+ if (Count >= maximumSelectablePages) {
+ break;
+ }
+ Page page = CreatePage(pageNumber);
+ Add(page);
+ }
+ }
+
+ int GetStartPage()
+ {
+ // Less pages than can be selected?
+ int totalPages = TotalPages;
+ if (totalPages <= maximumSelectablePages) {
+ return 1;
+ }
+
+ // First choice for start page.
+ int startPage = selectedPageNumber - (maximumSelectablePages / 2);
+ if (startPage <= 0) {
+ return 1;
+ }
+
+ // Do we have enough pages?
+ int totalPagesBasedOnStartPage = totalPages - startPage + 1;
+ if (totalPagesBasedOnStartPage >= maximumSelectablePages) {
+ return startPage;
+ }
+
+ // Ensure we have enough pages.
+ startPage -= maximumSelectablePages - totalPagesBasedOnStartPage;
+ if (startPage > 0) {
+ return startPage;
+ }
+ return 1;
+ }
+
+ Page CreatePage(int pageNumber)
+ {
+ var page = new Page();
+ page.Number = pageNumber;
+ page.IsSelected = IsSelectedPage(pageNumber);
+ return page;
+ }
+
+ bool IsSelectedPage(int pageNumber)
+ {
+ return pageNumber == selectedPageNumber;
+ }
+
+ public int TotalItemsOnSelectedPage {
+ get { return itemsOnSelectedPage; }
+ set {
+ itemsOnSelectedPage = value;
+ if (itemsOnSelectedPage < pageSize) {
+ TotalItems = (selectedPageNumber - 1) * pageSize + itemsOnSelectedPage;
+ }
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackageOperationEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackageOperationEventArgs.cs
new file mode 100644
index 0000000000..188fc5679f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackageOperationEventArgs.cs
@@ -0,0 +1,43 @@
+//
+// ParentPackageOperationEventArgs.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ParentPackageOperationEventArgs : EventArgs
+ {
+ public ParentPackageOperationEventArgs(IPackage package)
+ {
+ this.Package = package;
+ }
+
+ public IPackage Package { get; private set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackagesOperationEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackagesOperationEventArgs.cs
new file mode 100644
index 0000000000..29bb19c506
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackagesOperationEventArgs.cs
@@ -0,0 +1,44 @@
+//
+// ParentPackagesOperationEventArgs.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ParentPackagesOperationEventArgs : EventArgs
+ {
+ public ParentPackagesOperationEventArgs(IEnumerable<IPackage> packages)
+ {
+ this.Packages = packages;
+ }
+
+ public IEnumerable<IPackage> Packages { get; private set; }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Process.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Process.cs
new file mode 100644
index 0000000000..1185189f5f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Process.cs
@@ -0,0 +1,40 @@
+//
+// Process.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class Process : IProcess
+ {
+ public void Start(string fileName)
+ {
+ System.Diagnostics.Process.Start(fileName);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs
new file mode 100644
index 0000000000..7804cabf38
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageAction.cs
@@ -0,0 +1,158 @@
+//
+// ProcessPackageActions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public abstract class ProcessPackageAction : IPackageAction
+ {
+ IPackageManagementEvents packageManagementEvents;
+
+ public ProcessPackageAction(
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents)
+ {
+ this.Project = project;
+ this.packageManagementEvents = packageManagementEvents;
+ }
+
+ public IPackageManagementProject Project { get; set; }
+ public ILogger Logger { get; set; }
+ public IPackage Package { get; set; }
+ public SemanticVersion PackageVersion { get; set; }
+ public string PackageId { get; set; }
+ //public IPackageScriptRunner PackageScriptRunner { get; set; }
+ public bool AllowPrereleaseVersions { get; set; }
+
+ public virtual bool HasPackageScriptsToRun()
+ {
+ return false;
+ }
+
+ protected void OnParentPackageInstalled()
+ {
+ packageManagementEvents.OnParentPackageInstalled(Package);
+ }
+
+ protected void OnParentPackageUninstalled()
+ {
+ packageManagementEvents.OnParentPackageUninstalled(Package);
+ }
+
+ public void Execute()
+ {
+ BeforeExecute();
+ //if (PackageScriptRunner != null) {
+ // ExecuteWithScriptRunner();
+ //} else {
+ ExecuteCore();
+ //}
+ }
+
+ protected virtual void BeforeExecute()
+ {
+ GetLoggerIfMissing();
+ ConfigureProjectLogger();
+ GetPackageIfMissing();
+ }
+
+ void ExecuteWithScriptRunner()
+ {
+// using (RunPackageScriptsAction runScriptsAction = CreateRunPackageScriptsAction()) {
+// ExecuteCore();
+// }
+ }
+//
+// RunPackageScriptsAction CreateRunPackageScriptsAction()
+// {
+// return CreateRunPackageScriptsAction(PackageScriptRunner, Project);
+// }
+//
+// protected virtual RunPackageScriptsAction CreateRunPackageScriptsAction(
+// IPackageScriptRunner scriptRunner,
+// IPackageManagementProject project)
+// {
+// return new RunPackageScriptsAction(scriptRunner, project);
+// }
+
+ protected virtual void ExecuteCore()
+ {
+ }
+
+ void GetLoggerIfMissing()
+ {
+ if (Logger == null) {
+ Logger = new PackageManagementLogger(packageManagementEvents);
+ }
+ }
+
+ void ConfigureProjectLogger()
+ {
+ Project.Logger = Logger;
+ }
+
+ void GetPackageIfMissing()
+ {
+ if (Package == null) {
+ FindPackage();
+ }
+ if (Package == null) {
+ ThrowPackageNotFoundError(PackageId);
+ }
+ }
+
+ void FindPackage()
+ {
+ Package = Project
+ .SourceRepository
+ .FindPackage(PackageId, PackageVersion, AllowPrereleaseVersions, allowUnlisted: true);
+ }
+
+ void ThrowPackageNotFoundError(string packageId)
+ {
+ string message = String.Format("Unable to find package '{0}'.", packageId);
+ throw new ApplicationException(message);
+ }
+
+ protected bool PackageIdExistsInProject()
+ {
+ string id = GetPackageId();
+ return Project.IsPackageInstalled(id);
+ }
+
+ string GetPackageId()
+ {
+ if (Package != null) {
+ return Package.Id;
+ }
+ return PackageId;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs
new file mode 100644
index 0000000000..ca93708f94
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs
@@ -0,0 +1,71 @@
+//
+// ProcessPackageOperationsAction.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public abstract class ProcessPackageOperationsAction : ProcessPackageAction
+ {
+ public ProcessPackageOperationsAction(
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents)
+ : base(project, packageManagementEvents)
+ {
+ }
+
+ public IEnumerable<PackageOperation> Operations { get; set; }
+
+ public override bool HasPackageScriptsToRun()
+ {
+ BeforeExecute();
+ var files = new PackageFilesForOperations(Operations);
+ return files.HasAnyPackageScripts();
+ }
+
+ protected override void BeforeExecute()
+ {
+ base.BeforeExecute();
+ GetPackageOperationsIfMissing();
+ }
+
+ void GetPackageOperationsIfMissing()
+ {
+ if (Operations == null) {
+ Operations = GetPackageOperations();
+ }
+ }
+
+ protected virtual IEnumerable<PackageOperation> GetPackageOperations()
+ {
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectBrowserUpdater.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectBrowserUpdater.cs
new file mode 100644
index 0000000000..05286f4e49
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectBrowserUpdater.cs
@@ -0,0 +1,68 @@
+//
+// ProjectBrowserUpdater.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ProjectBrowserUpdater : IProjectBrowserUpdater
+ {
+// ProjectBrowserControl projectBrowser;
+//
+// public ProjectBrowserUpdater()
+// : this(ProjectBrowserPad.Instance.ProjectBrowserControl)
+// {
+// }
+//
+// public ProjectBrowserUpdater(ProjectBrowserControl projectBrowser)
+// {
+// this.projectBrowser = projectBrowser;
+// ProjectService.ProjectItemAdded += ProjectItemAdded;
+// }
+//
+// protected virtual void ProjectItemAdded(object sender, ProjectItemEventArgs e)
+// {
+// if (e.ProjectItem is FileProjectItem) {
+// AddFileProjectItemToProjectBrowser(e);
+// }
+// }
+//
+// void AddFileProjectItemToProjectBrowser(ProjectItemEventArgs e)
+// {
+// var visitor = new UpdateProjectBrowserFileNodesVisitor(e);
+// foreach (AbstractProjectBrowserTreeNode node in projectBrowser.TreeView.Nodes) {
+// node.AcceptVisitor(visitor, null);
+// }
+// }
+
+ public void Dispose()
+ {
+ // ProjectService.ProjectItemAdded -= ProjectItemAdded;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectExtensions.cs
new file mode 100644
index 0000000000..61f1461115
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectExtensions.cs
@@ -0,0 +1,42 @@
+//
+// ProjectExtensions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Projects;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class ProjectExtensions
+ {
+ public static void Save(this Project project)
+ {
+ project.Save(new NullProgressMonitor());
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFramework.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFramework.cs
new file mode 100644
index 0000000000..249dc72c36
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTargetFramework.cs
@@ -0,0 +1,93 @@
+//
+// ProjectTargetFramework.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Runtime.Versioning;
+using MonoDevelop.Core.Assemblies;
+using MonoDevelop.Projects;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ProjectTargetFramework
+ {
+ DotNetProject project;
+ FrameworkName targetFramework;
+
+ public ProjectTargetFramework(DotNetProject project)
+ {
+ this.project = project;
+ GetTargetFramework();
+ }
+
+ void GetTargetFramework()
+ {
+ string identifier = GetTargetFrameworkIdentifier();
+ string version = GetTargetFrameworkVersion();
+ string profile = GetTargetFrameworkProfile();
+
+ GetTargetFramework(identifier, version, profile);
+ }
+
+ void GetTargetFramework(string identifier, string version, string profile)
+ {
+ string name = String.Format("{0}, Version={1}, Profile={2}", identifier, version, profile);
+ targetFramework = new FrameworkName(name);
+ }
+
+ string GetTargetFrameworkIdentifier()
+ {
+ return UseDefaultIfNullOrEmpty(TargetFrameworkMoniker.Identifier, ".NETFramework");
+ }
+
+ TargetFrameworkMoniker TargetFrameworkMoniker {
+ get { return project.TargetFramework.Id; }
+ }
+
+ string UseDefaultIfNullOrEmpty(string value, string defaultValue)
+ {
+ if (String.IsNullOrEmpty(value)) {
+ return defaultValue;
+ }
+ return value;
+ }
+
+ string GetTargetFrameworkVersion()
+ {
+ return TargetFrameworkMoniker.Version;
+ }
+
+ string GetTargetFrameworkProfile()
+ {
+ return UseDefaultIfNullOrEmpty(TargetFrameworkMoniker.Profile, String.Empty);
+ }
+
+ public FrameworkName TargetFrameworkName {
+ get { return targetFramework; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageRepositoryCache.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageRepositoryCache.cs
new file mode 100644
index 0000000000..4d609bdba9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageRepositoryCache.cs
@@ -0,0 +1,99 @@
+//
+// ProjectTemplatePackageRepositoryCache.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ /// <summary>
+ /// Supports a configurable set of package repositories for project templates that can be
+ /// different to the registered package repositories used with the Add Package Reference dialog.
+ /// </summary>
+ public class ProjectTemplatePackageRepositoryCache : IPackageRepositoryCache
+ {
+ IPackageRepositoryCache packageRepositoryCache;
+ RegisteredProjectTemplatePackageSources registeredPackageSources;
+
+ /// <summary>
+ /// Creates a new instance of the ProjectTemplatePackageRepositoryCache.
+ /// </summary>
+ /// <param name="packageRepositoryCache">The main package repository cache used
+ /// with the Add Package Reference dialog.</param>
+ public ProjectTemplatePackageRepositoryCache(
+ IPackageRepositoryCache packageRepositoryCache,
+ RegisteredProjectTemplatePackageSources registeredPackageSources)
+ {
+ this.packageRepositoryCache = packageRepositoryCache;
+ this.registeredPackageSources = registeredPackageSources;
+ }
+
+ public IRecentPackageRepository RecentPackageRepository {
+ get { throw new NotImplementedException(); }
+ }
+
+ public IPackageRepository CreateAggregateRepository()
+ {
+ IEnumerable<IPackageRepository> repositories = GetRegisteredPackageRepositories();
+ return CreateAggregateRepository(repositories);
+ }
+
+ IEnumerable<IPackageRepository> GetRegisteredPackageRepositories()
+ {
+ foreach (PackageSource packageSource in GetEnabledPackageSources()) {
+ yield return CreateRepository(packageSource.Source);
+ }
+ }
+
+ public IEnumerable<PackageSource> GetEnabledPackageSources()
+ {
+ return registeredPackageSources.PackageSources.GetEnabledPackageSources();
+ }
+
+ public ISharedPackageRepository CreateSharedRepository(IPackagePathResolver pathResolver, IFileSystem fileSystem, IFileSystem configSettingsFileSystem)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IRecentPackageRepository CreateRecentPackageRepository(IList<RecentPackageInfo> recentPackages, IPackageRepository aggregateRepository)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IPackageRepository CreateAggregateRepository(IEnumerable<IPackageRepository> repositories)
+ {
+ return packageRepositoryCache.CreateAggregateRepository(repositories);
+ }
+
+ public IPackageRepository CreateRepository(string packageSource)
+ {
+ return packageRepositoryCache.CreateRepository(packageSource);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageSettingsFileName.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageSettingsFileName.cs
new file mode 100644
index 0000000000..ad395570c7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageSettingsFileName.cs
@@ -0,0 +1,47 @@
+//
+// ProjectTemplatePackageSettingsFileName.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ProjectTemplatePackagesSettingsFileName
+ {
+ string directory;
+
+ public ProjectTemplatePackagesSettingsFileName(IPropertyService propertyService)
+ {
+ directory = Path.Combine(propertyService.ConfigDirectory, "templates");
+ }
+
+ public string Directory {
+ get { return directory; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageInfo.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageInfo.cs
new file mode 100644
index 0000000000..415d15f8fc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageInfo.cs
@@ -0,0 +1,70 @@
+//
+// RecentPackageInfo.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class RecentPackageInfo
+ {
+ SemanticVersion version;
+
+ public RecentPackageInfo()
+ {
+ }
+
+ public RecentPackageInfo(IPackage package)
+ : this(package.Id, package.Version)
+ {
+ }
+
+ public RecentPackageInfo(string id, SemanticVersion version)
+ {
+ this.Id = id;
+ this.version = version;
+ }
+
+ public string Id { get; set; }
+
+ public string Version {
+ get { return version.ToString(); }
+ set { version = new SemanticVersion(value); }
+ }
+
+ public override string ToString()
+ {
+ return String.Format("[RecentPackageInfo Id={0}, Version={1}]", Id, Version);
+ }
+
+ public bool IsMatch(IPackage package)
+ {
+ return (package.Version.ToString() == Version) && (package.Id == Id);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageRepository.cs
new file mode 100644
index 0000000000..39cc43bd55
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageRepository.cs
@@ -0,0 +1,195 @@
+//
+// RecentPackageRepository.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class RecentPackageRepository : IRecentPackageRepository
+ {
+ public const int DefaultMaximumPackagesCount = 20;
+
+ List<IPackage> packages = new List<IPackage>();
+ int maximumPackagesCount = DefaultMaximumPackagesCount;
+ IList<RecentPackageInfo> savedRecentPackages;
+ IPackageRepository aggregateRepository;
+ IPackageManagementEvents packageManagementEvents;
+
+ public RecentPackageRepository(
+ IList<RecentPackageInfo> recentPackages,
+ IPackageRepository aggregateRepository,
+ IPackageManagementEvents packageManagementEvents)
+ {
+ this.savedRecentPackages = recentPackages;
+ this.aggregateRepository = aggregateRepository;
+ this.packageManagementEvents = packageManagementEvents;
+
+ this.packageManagementEvents.ParentPackageInstalled += ParentPackageInstalled;
+ }
+
+ void ParentPackageInstalled(object sender, ParentPackageOperationEventArgs e)
+ {
+ AddPackage(e.Package);
+ }
+
+ public string Source {
+ get { return "RecentPackages"; }
+ }
+
+ public void AddPackage(IPackage package)
+ {
+ RemovePackageIfAlreadyAdded(package);
+ AddPackageAtBeginning(package);
+ RemoveLastPackageIfCurrentPackageCountExceedsMaximum();
+ UpdateRecentPackagesInOptions();
+ }
+
+ void RemovePackageIfAlreadyAdded(IPackage package)
+ {
+ int index = FindPackage(package);
+ if (index >= 0) {
+ packages.RemoveAt(index);
+ }
+ }
+
+ int FindPackage(IPackage package)
+ {
+ return packages.FindIndex(p => PackageEqualityComparer.IdAndVersion.Equals(package, p));
+ }
+
+ void AddPackageAtBeginning(IPackage package)
+ {
+ packages.Insert(0, package);
+ }
+
+ void RemoveLastPackageIfCurrentPackageCountExceedsMaximum()
+ {
+ if (packages.Count > maximumPackagesCount) {
+ RemoveLastPackage();
+ }
+ }
+
+ void RemoveLastPackage()
+ {
+ packages.RemoveAt(packages.Count - 1);
+ }
+
+ void UpdateRecentPackagesInOptions()
+ {
+ savedRecentPackages.Clear();
+ savedRecentPackages.AddRange(GetRecentPackagesInfo());
+ }
+
+ List<RecentPackageInfo> GetRecentPackagesInfo()
+ {
+ List<RecentPackageInfo> allRecentPackages = new List<RecentPackageInfo>();
+ foreach (IPackage package in packages) {
+ var recentPackageInfo = new RecentPackageInfo(package);
+ allRecentPackages.Add(recentPackageInfo);
+ }
+ return allRecentPackages;
+ }
+
+ public void RemovePackage(IPackage package)
+ {
+ }
+
+ public IQueryable<IPackage> GetPackages()
+ {
+ UpdatePackages();
+ return packages.AsQueryable();
+ }
+
+ void UpdatePackages()
+ {
+ if (!HasRecentPackagesBeenRead() && HasRecentPackages) {
+ IEnumerable<IPackage> recentPackages = GetRecentPackages();
+ packages.AddRange(recentPackages);
+ }
+ }
+
+ bool HasRecentPackagesBeenRead()
+ {
+ return packages.Count > 0;
+ }
+
+ public bool HasRecentPackages {
+ get { return savedRecentPackages.Count > 0; }
+ }
+
+ IEnumerable<IPackage> GetRecentPackages()
+ {
+ IEnumerable<IPackage> recentPackages = GetRecentPackagesFilteredById();
+ return GetRecentPackagesFilteredByVersion(recentPackages);
+ }
+
+ IEnumerable<IPackage> GetRecentPackagesFilteredById()
+ {
+ IEnumerable<string> recentPackageIds = GetRecentPackageIds();
+ return aggregateRepository.FindPackages(recentPackageIds);
+ }
+
+ IEnumerable<string> GetRecentPackageIds()
+ {
+ foreach (RecentPackageInfo recentPackageInfo in savedRecentPackages) {
+ yield return recentPackageInfo.Id;
+ }
+ }
+
+ IEnumerable<IPackage> GetRecentPackagesFilteredByVersion(IEnumerable<IPackage> recentPackages)
+ {
+ List<IPackage> filteredRecentPackages = new List<IPackage>();
+ foreach (IPackage recentPackage in recentPackages) {
+ foreach (RecentPackageInfo savedRecentPackageInfo in savedRecentPackages) {
+ if (savedRecentPackageInfo.IsMatch(recentPackage)) {
+ filteredRecentPackages.Add(recentPackage);
+ }
+ }
+ }
+ return filteredRecentPackages;
+ }
+
+ public int MaximumPackagesCount {
+ get { return maximumPackagesCount; }
+ set { maximumPackagesCount = value; }
+ }
+
+ public void Clear()
+ {
+ packages.Clear();
+ UpdateRecentPackagesInOptions();
+ }
+
+ public bool SupportsPrereleasePackages {
+ get { return false; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackagesViewModel.cs
new file mode 100644
index 0000000000..4f4b6e00fb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackagesViewModel.cs
@@ -0,0 +1,76 @@
+//
+// RecentPackagesViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class RecentPackagesViewModel : PackagesViewModel
+ {
+ IPackageManagementEvents packageManagementEvents;
+ IPackageRepository recentPackageRepository;
+
+ public RecentPackagesViewModel(
+ IPackageManagementEvents packageManagementEvents,
+ IRegisteredPackageRepositories registeredPackageRepositories,
+ IPackageViewModelFactory packageViewModelFactory,
+ ITaskFactory taskFactory)
+ : base(registeredPackageRepositories, packageViewModelFactory, taskFactory)
+ {
+ this.packageManagementEvents = packageManagementEvents;
+
+ recentPackageRepository = registeredPackageRepositories.RecentPackageRepository;
+
+ packageManagementEvents.ParentPackageInstalled += ParentPackageInstalled;
+ packageManagementEvents.ParentPackageUninstalled += ParentPackageUninstalled;
+ }
+
+ void ParentPackageInstalled(object sender, EventArgs e)
+ {
+ ReadPackages();
+ }
+
+ void ParentPackageUninstalled(object sender, EventArgs e)
+ {
+ ReadPackages();
+ }
+
+ protected override void OnDispose()
+ {
+ packageManagementEvents.ParentPackageInstalled -= ParentPackageInstalled;
+ packageManagementEvents.ParentPackageUninstalled -= ParentPackageUninstalled;
+ }
+
+ protected override IQueryable<IPackage> GetAllPackages()
+ {
+ return recentPackageRepository.GetPackages();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReducedPackageOperations.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReducedPackageOperations.cs
new file mode 100644
index 0000000000..c1e937ef5d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ReducedPackageOperations.cs
@@ -0,0 +1,77 @@
+//
+// ReducedPackageOperations.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ReducedPackageOperations
+ {
+ IPackageOperationResolver resolver;
+ IList<PackageOperation> operations;
+ IEnumerable<IPackage> packages;
+
+ public ReducedPackageOperations(IPackageOperationResolver resolver, IEnumerable<IPackage> packages)
+ {
+ this.resolver = resolver;
+ this.packages = packages;
+ this.operations = new List<PackageOperation>();
+ }
+
+ public IEnumerable<PackageOperation> Operations {
+ get { return operations; }
+ }
+
+ public void Reduce()
+ {
+ foreach (IPackage package in packages) {
+ if (!InstallOperationExists(package)) {
+ operations.AddRange(resolver.ResolveOperations(package));
+ }
+ }
+
+ operations = operations.Reduce();
+ }
+
+ bool InstallOperationExists(IPackage package)
+ {
+ var installOperation = new PackageOperation(package, PackageAction.Install);
+ return operations.Any(operation => IsMatch(installOperation, operation));
+ }
+
+ bool IsMatch(PackageOperation x, PackageOperation y)
+ {
+ return (x.Package.Id == y.Package.Id) &&
+ (x.Package.Version == y.Package.Version) &&
+ (x.Action == y.Action);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageRepositories.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageRepositories.cs
new file mode 100644
index 0000000000..761133ca3d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageRepositories.cs
@@ -0,0 +1,111 @@
+//
+// RegisteredPackageRepositories.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class RegisteredPackageRepositories : IRegisteredPackageRepositories
+ {
+ IPackageRepositoryCache repositoryCache;
+ PackageManagementOptions options;
+ RegisteredPackageSources registeredPackageSources;
+ PackageSource activePackageSource;
+ IPackageRepository activePackageRepository;
+
+ public RegisteredPackageRepositories(
+ IPackageRepositoryCache repositoryCache,
+ PackageManagementOptions options)
+ {
+ this.repositoryCache = repositoryCache;
+ this.options = options;
+ registeredPackageSources = options.PackageSources;
+ }
+
+ public IRecentPackageRepository RecentPackageRepository {
+ get { return repositoryCache.RecentPackageRepository; }
+ }
+
+ public IPackageRepository CreateRepository(PackageSource source)
+ {
+ return repositoryCache.CreateRepository(source.Source);
+ }
+
+ public IPackageRepository CreateAggregateRepository()
+ {
+ return repositoryCache.CreateAggregateRepository();
+ }
+
+ public RegisteredPackageSources PackageSources {
+ get { return options.PackageSources; }
+ }
+
+ public bool HasMultiplePackageSources {
+ get { return registeredPackageSources.HasMultipleEnabledPackageSources; }
+ }
+
+ public PackageSource ActivePackageSource {
+ get {
+ activePackageSource = options.ActivePackageSource;
+ if (activePackageSource == null) {
+ if (options.PackageSources.Any()) {
+ activePackageSource = options.PackageSources[0];
+ }
+ }
+ return activePackageSource;
+ }
+ set {
+ if (activePackageSource != value) {
+ activePackageSource = value;
+ options.ActivePackageSource = value;
+ activePackageRepository = null;
+ }
+ }
+ }
+
+ public IPackageRepository ActiveRepository {
+ get {
+ if (activePackageRepository == null) {
+ CreateActiveRepository();
+ }
+ return activePackageRepository;
+ }
+ }
+
+ void CreateActiveRepository()
+ {
+ if (ActivePackageSource.IsAggregate()) {
+ activePackageRepository = CreateAggregateRepository();
+ } else {
+ activePackageRepository = repositoryCache.CreateRepository(ActivePackageSource.Source);
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSource.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSource.cs
new file mode 100644
index 0000000000..7aaa4376eb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSource.cs
@@ -0,0 +1,56 @@
+//
+// RegisteredPackageSource.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class RegisteredPackageSource
+ {
+ public string Source { get; set; }
+ public string Name { get; set; }
+ public bool IsEnabled { get; set; }
+
+ public RegisteredPackageSource()
+ {
+ }
+
+ public RegisteredPackageSource(PackageSource packageSource)
+ {
+ Source = packageSource.Source;
+ Name = packageSource.Name;
+ IsEnabled = packageSource.IsEnabled;
+ }
+
+ public PackageSource ToPackageSource()
+ {
+ return new PackageSource(Source, Name, IsEnabled);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
new file mode 100644
index 0000000000..aa429295ed
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
@@ -0,0 +1,190 @@
+//
+// RegisteredPackageSourceSettings.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class RegisteredPackageSourceSettings
+ {
+ public static readonly string PackageSourcesSectionName = "packageSources";
+ public static readonly string ActivePackageSourceSectionName = "activePackageSource";
+ public static readonly string DisabledPackageSourceSectionName = "disabledPackageSources";
+
+ public static readonly PackageSource AggregatePackageSource =
+ new PackageSource("(Aggregate source)", "All");
+
+ ISettings settings;
+ PackageSource defaultPackageSource;
+ RegisteredPackageSources packageSources;
+ PackageSource activePackageSource;
+
+ public RegisteredPackageSourceSettings(ISettings settings)
+ : this(settings, RegisteredPackageSources.DefaultPackageSource)
+ {
+ }
+
+ public RegisteredPackageSourceSettings(ISettings settings, PackageSource defaultPackageSource)
+ {
+ this.settings = settings;
+ this.defaultPackageSource = defaultPackageSource;
+ ReadActivePackageSource();
+ }
+
+ void ReadActivePackageSource()
+ {
+ IList<KeyValuePair<string, string>> packageSources = settings.GetValues(ActivePackageSourceSectionName);
+ activePackageSource = PackageSourceConverter.ConvertFromFirstKeyValuePair(packageSources);
+ }
+
+ public RegisteredPackageSources PackageSources {
+ get {
+ if (packageSources == null) {
+ ReadPackageSources();
+ }
+ return packageSources;
+ }
+ }
+
+ void ReadPackageSources()
+ {
+ IEnumerable<PackageSource> savedPackageSources = GetPackageSourcesFromSettings();
+ packageSources = new RegisteredPackageSources(savedPackageSources, defaultPackageSource);
+ packageSources.CollectionChanged += PackageSourcesChanged;
+
+ if (!savedPackageSources.Any()) {
+ UpdatePackageSourceSettingsWithChanges();
+ }
+ }
+
+ IEnumerable<PackageSource> GetPackageSourcesFromSettings()
+ {
+ IList<KeyValuePair<string, string>> savedPackageSources = settings.GetValues(PackageSourcesSectionName);
+ foreach (PackageSource packageSource in PackageSourceConverter.ConvertFromKeyValuePairs(savedPackageSources)) {
+ packageSource.IsEnabled = IsPackageSourceEnabled(packageSource);
+ yield return packageSource;
+ }
+ }
+
+ bool IsPackageSourceEnabled(PackageSource packageSource)
+ {
+ string disabled = settings.GetValue(DisabledPackageSourceSectionName, packageSource.Name);
+ return String.IsNullOrEmpty(disabled);
+ }
+
+ void PackageSourcesChanged(object sender, NotifyCollectionChangedEventArgs e)
+ {
+ UpdatePackageSourceSettingsWithChanges();
+ }
+
+ void UpdatePackageSourceSettingsWithChanges()
+ {
+ IList<KeyValuePair<string, string>> newPackageSourceSettings = GetSettingsFromPackageSources();
+ SavePackageSourceSettings(newPackageSourceSettings);
+ IList<KeyValuePair<string, string>> disabledPackageSourceSettings = GetSettingsForDisabledPackageSources();
+ SaveDisabledPackageSourceSettings(disabledPackageSourceSettings);
+ }
+
+ IList<KeyValuePair<string, string>> GetSettingsFromPackageSources()
+ {
+ return PackageSourceConverter.ConvertToKeyValuePairList(packageSources);
+ }
+
+ KeyValuePair<string, string> CreateKeyValuePairFromPackageSource(PackageSource source)
+ {
+ return new KeyValuePair<string, string>(source.Name, source.Source);
+ }
+
+ void SavePackageSourceSettings(IList<KeyValuePair<string, string>> newPackageSourceSettings)
+ {
+ settings.DeleteSection(PackageSourcesSectionName);
+ settings.SetValues(PackageSourcesSectionName, newPackageSourceSettings);
+ }
+
+ IList<KeyValuePair<string, string>> GetSettingsForDisabledPackageSources()
+ {
+ return packageSources
+ .Where(source => !source.IsEnabled)
+ .Select(source => new KeyValuePair<string, string>(source.Name, "true"))
+ .ToList();
+ }
+
+ void SaveDisabledPackageSourceSettings(IList<KeyValuePair<string, string>> disabledPackageSourceSettings)
+ {
+ settings.DeleteSection(DisabledPackageSourceSectionName);
+ if (disabledPackageSourceSettings.Any()) {
+ settings.SetValues(DisabledPackageSourceSectionName, disabledPackageSourceSettings);
+ }
+ }
+
+ public PackageSource ActivePackageSource {
+ get {
+ if (activePackageSource != null) {
+ if (activePackageSource.IsAggregate()) {
+ return activePackageSource;
+ }
+ if (PackageSources.Contains(activePackageSource)) {
+ return activePackageSource;
+ }
+ }
+ return null;
+ }
+ set {
+ activePackageSource = value;
+ if (activePackageSource == null) {
+ RemoveActivePackageSourceSetting();
+ } else {
+ UpdateActivePackageSourceSetting();
+ }
+ }
+ }
+
+ void RemoveActivePackageSourceSetting()
+ {
+ settings.DeleteSection(ActivePackageSourceSectionName);
+ }
+
+ void UpdateActivePackageSourceSetting()
+ {
+ RemoveActivePackageSourceSetting();
+
+ KeyValuePair<string, string> activePackageSourceSetting = PackageSourceConverter.ConvertToKeyValuePair(activePackageSource);
+ SaveActivePackageSourceSetting(activePackageSourceSetting);
+ }
+
+ void SaveActivePackageSourceSetting(KeyValuePair<string, string> activePackageSource)
+ {
+ settings.SetValue(ActivePackageSourceSectionName, activePackageSource.Key, activePackageSource.Value);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs
new file mode 100644
index 0000000000..c9635fc678
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSources.cs
@@ -0,0 +1,85 @@
+//
+// RegisteredPackgaeSources.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class RegisteredPackageSources : ObservableCollection<PackageSource>
+ {
+ public static readonly string DefaultPackageSourceUrl = "https://www.nuget.org/api/v2/";
+ public static readonly string DefaultPackageSourceName = "nuget.org";
+
+ public static readonly PackageSource DefaultPackageSource =
+ new PackageSource(DefaultPackageSourceUrl, DefaultPackageSourceName);
+
+ public RegisteredPackageSources(IEnumerable<PackageSource> packageSources)
+ : this(packageSources, DefaultPackageSource)
+ {
+ }
+
+ public RegisteredPackageSources(
+ IEnumerable<PackageSource> packageSources,
+ PackageSource defaultPackageSource)
+ {
+ AddPackageSources(packageSources);
+ AddDefaultPackageSourceIfNoRegisteredPackageSources(defaultPackageSource);
+ }
+
+ void AddPackageSources(IEnumerable<PackageSource> packageSources)
+ {
+ foreach (PackageSource source in packageSources) {
+ Add(source);
+ }
+ }
+
+ void AddDefaultPackageSourceIfNoRegisteredPackageSources(PackageSource defaultPackageSource)
+ {
+ if (HasNoRegisteredPackageSources) {
+ Add(defaultPackageSource);
+ }
+ }
+
+ bool HasNoRegisteredPackageSources {
+ get { return Count == 0; }
+ }
+
+ public bool HasMultipleEnabledPackageSources {
+ get { return GetEnabledPackageSources().Count() > 1; }
+ }
+
+ public IEnumerable<PackageSource> GetEnabledPackageSources()
+ {
+ return this.Where(packageSource => packageSource.IsEnabled);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourcesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourcesViewModel.cs
new file mode 100644
index 0000000000..290e60c92d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourcesViewModel.cs
@@ -0,0 +1,285 @@
+//
+// RegisteredPackageSourcesViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class RegisteredPackageSourcesViewModel : ViewModelBase<RegisteredPackageSourcesViewModel>
+ {
+ ObservableCollection<PackageSourceViewModel> packageSourceViewModels =
+ new ObservableCollection<PackageSourceViewModel>();
+ RegisteredPackageSources packageSources;
+ IFolderBrowser folderBrowser;
+
+ DelegateCommand addPackageSourceCommmand;
+ DelegateCommand removePackageSourceCommand;
+ DelegateCommand movePackageSourceUpCommand;
+ DelegateCommand movePackageSourceDownCommand;
+ DelegateCommand browsePackageFolderCommand;
+
+ RegisteredPackageSource newPackageSource = new RegisteredPackageSource();
+ PackageSourceViewModel selectedPackageSourceViewModel;
+
+ public RegisteredPackageSourcesViewModel(
+ RegisteredPackageSources packageSources)
+ : this(packageSources, new FolderBrowser())
+ {
+ }
+
+ public RegisteredPackageSourcesViewModel(
+ RegisteredPackageSources packageSources,
+ IFolderBrowser folderBrowser)
+ {
+ this.packageSources = packageSources;
+ this.folderBrowser = folderBrowser;
+ CreateCommands();
+ }
+
+ void CreateCommands()
+ {
+ addPackageSourceCommmand =
+ new DelegateCommand(param => AddPackageSource(),
+ param => CanAddPackageSource);
+
+ removePackageSourceCommand =
+ new DelegateCommand(param => RemovePackageSource(),
+ param => CanRemovePackageSource);
+
+ movePackageSourceUpCommand =
+ new DelegateCommand(param => MovePackageSourceUp(),
+ param => CanMovePackageSourceUp);
+
+ movePackageSourceDownCommand =
+ new DelegateCommand(param => MovePackageSourceDown(),
+ param => CanMovePackageSourceDown);
+
+ browsePackageFolderCommand =
+ new DelegateCommand(param => BrowsePackageFolder());
+ }
+
+ public ICommand AddPackageSourceCommand {
+ get { return addPackageSourceCommmand; }
+ }
+
+ public ICommand RemovePackageSourceCommand {
+ get { return removePackageSourceCommand; }
+ }
+
+ public ICommand MovePackageSourceUpCommand {
+ get { return movePackageSourceUpCommand; }
+ }
+
+ public ICommand MovePackageSourceDownCommand {
+ get { return movePackageSourceDownCommand; }
+ }
+
+ public ICommand BrowsePackageFolderCommand {
+ get { return browsePackageFolderCommand; }
+ }
+
+ public ObservableCollection<PackageSourceViewModel> PackageSourceViewModels {
+ get { return packageSourceViewModels; }
+ }
+
+ public void Load()
+ {
+ foreach (PackageSource packageSource in packageSources) {
+ AddPackageSourceToViewModel(packageSource);
+ }
+ }
+
+ void AddPackageSourceToViewModel(PackageSource packageSource)
+ {
+ var packageSourceViewModel = new PackageSourceViewModel(packageSource);
+ packageSourceViewModels.Add(packageSourceViewModel);
+ }
+
+ public void Save()
+ {
+ packageSources.Clear();
+ foreach (PackageSourceViewModel packageSourceViewModel in packageSourceViewModels) {
+ PackageSource source = packageSourceViewModel.GetPackageSource();
+ packageSources.Add(source);
+ }
+ }
+
+ public string NewPackageSourceName {
+ get { return newPackageSource.Name; }
+ set {
+ newPackageSource.Name = value;
+ OnPropertyChanged(viewModel => viewModel.NewPackageSourceName);
+ }
+ }
+
+ public string NewPackageSourceUrl {
+ get { return newPackageSource.Source; }
+ set {
+ newPackageSource.Source = value;
+ OnPropertyChanged(viewModel => viewModel.NewPackageSourceUrl);
+ }
+ }
+
+ public PackageSourceViewModel SelectedPackageSourceViewModel {
+ get { return selectedPackageSourceViewModel; }
+ set {
+ selectedPackageSourceViewModel = value;
+ OnPropertyChanged(viewModel => viewModel.SelectedPackageSourceViewModel);
+ OnPropertyChanged(viewModel => viewModel.CanAddPackageSource);
+ }
+ }
+
+ public void AddPackageSource()
+ {
+ AddNewPackageSourceToViewModel();
+ SelectLastPackageSourceViewModel();
+ }
+
+ void AddNewPackageSourceToViewModel()
+ {
+ var packageSource = newPackageSource.ToPackageSource();
+ AddPackageSourceToViewModel(packageSource);
+ }
+
+ void SelectLastPackageSourceViewModel()
+ {
+ SelectedPackageSourceViewModel = GetLastPackageSourceViewModel();
+ }
+
+ public bool CanAddPackageSource {
+ get { return NewPackageSourceHasUrl && NewPackageSourceHasName; }
+ }
+
+ bool NewPackageSourceHasUrl {
+ get { return !String.IsNullOrEmpty(NewPackageSourceUrl); }
+ }
+
+ bool NewPackageSourceHasName {
+ get { return !String.IsNullOrEmpty(NewPackageSourceName); }
+ }
+
+ public void RemovePackageSource()
+ {
+ RemoveSelectedPackageSourceViewModel();
+ }
+
+ public bool CanRemovePackageSource {
+ get { return IsPackageSourceSelected(); }
+ }
+
+ void RemoveSelectedPackageSourceViewModel()
+ {
+ packageSourceViewModels.Remove(selectedPackageSourceViewModel);
+ }
+
+ public void MovePackageSourceUp()
+ {
+ int selectedPackageSourceIndex = GetSelectedPackageSourceViewModelIndex();
+ int destinationPackageSourceIndex = selectedPackageSourceIndex--;
+ packageSourceViewModels.Move(selectedPackageSourceIndex, destinationPackageSourceIndex);
+ }
+
+ int GetSelectedPackageSourceViewModelIndex()
+ {
+ return packageSourceViewModels.IndexOf(selectedPackageSourceViewModel);
+ }
+
+ public bool CanMovePackageSourceUp {
+ get {
+ return HasAtLeastTwoPackageSources() &&
+ IsPackageSourceSelected() &&
+ !IsFirstPackageSourceSelected();
+ }
+ }
+
+ bool IsPackageSourceSelected()
+ {
+ return selectedPackageSourceViewModel != null;
+ }
+
+ bool IsFirstPackageSourceSelected()
+ {
+ return selectedPackageSourceViewModel == packageSourceViewModels[0];
+ }
+
+ public void MovePackageSourceDown()
+ {
+ int selectedPackageSourceIndex = GetSelectedPackageSourceViewModelIndex();
+ int destinationPackageSourceIndex = selectedPackageSourceIndex++;
+ packageSourceViewModels.Move(selectedPackageSourceIndex, destinationPackageSourceIndex);
+ }
+
+ public bool CanMovePackageSourceDown {
+ get {
+ return HasAtLeastTwoPackageSources() &&
+ IsPackageSourceSelected() &&
+ !IsLastPackageSourceSelected();
+ }
+ }
+
+ bool HasAtLeastTwoPackageSources()
+ {
+ return packageSourceViewModels.Count >= 2;
+ }
+
+ bool IsLastPackageSourceSelected()
+ {
+ PackageSourceViewModel lastViewModel = GetLastPackageSourceViewModel();
+ return lastViewModel == selectedPackageSourceViewModel;
+ }
+
+ PackageSourceViewModel GetLastPackageSourceViewModel()
+ {
+ return packageSourceViewModels.Last();
+ }
+
+ public void BrowsePackageFolder()
+ {
+ string folder = folderBrowser.SelectFolder();
+ if (folder != null) {
+ UpdateNewPackageSourceUsingSelectedFolder(folder);
+ }
+ }
+
+ void UpdateNewPackageSourceUsingSelectedFolder(string folder)
+ {
+ NewPackageSourceUrl = folder;
+ NewPackageSourceName = GetPackageSourceNameFromFolder(folder);
+ }
+
+ string GetPackageSourceNameFromFolder(string folder)
+ {
+ return Path.GetFileName(folder);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredProjectTemplatePackageSources.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredProjectTemplatePackageSources.cs
new file mode 100644
index 0000000000..c95199b4cc
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredProjectTemplatePackageSources.cs
@@ -0,0 +1,74 @@
+//
+// RegisteredProjectTemplatePackageSources.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class RegisteredProjectTemplatePackageSources
+ {
+ RegisteredPackageSourceSettings registeredPackageSourceSettings;
+
+ public RegisteredProjectTemplatePackageSources()
+ : this(new PackageManagementPropertyService(), new SettingsFactory())
+ {
+ }
+
+ public RegisteredProjectTemplatePackageSources(
+ IPropertyService propertyService,
+ ISettingsFactory settingsFactory)
+ {
+ GetRegisteredPackageSources(propertyService, settingsFactory);
+ }
+
+ void GetRegisteredPackageSources(IPropertyService propertyService, ISettingsFactory settingsFactory)
+ {
+ ISettings settings = CreateSettings(propertyService, settingsFactory);
+ PackageSource defaultPackageSource = CreateDefaultPackageSource(propertyService);
+ registeredPackageSourceSettings = new RegisteredPackageSourceSettings(settings, defaultPackageSource);
+ }
+
+ ISettings CreateSettings(IPropertyService propertyService, ISettingsFactory settingsFactory)
+ {
+ var settingsFileName = new ProjectTemplatePackagesSettingsFileName(propertyService);
+ return settingsFactory.CreateSettings(settingsFileName.Directory);
+ }
+
+ PackageSource CreateDefaultPackageSource(IPropertyService propertyService)
+ {
+ var defaultPackageSource = new DefaultProjectTemplatePackageSource(propertyService);
+ return defaultPackageSource.PackageSource;
+ }
+
+ public RegisteredPackageSources PackageSources {
+ get { return registeredPackageSourceSettings.PackageSources; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs
new file mode 100644
index 0000000000..b26f68d526
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs
@@ -0,0 +1,60 @@
+//
+// RemovedPackageReferenceMonitor.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class RemovedPackageReferenceMonitor : IDisposable
+ {
+ ISharpDevelopProjectManager projectManager;
+ List<IPackage> packagesRemoved = new List<IPackage>();
+
+ public RemovedPackageReferenceMonitor(ISharpDevelopProjectManager projectManager)
+ {
+ this.projectManager = projectManager;
+ projectManager.PackageReferenceRemoved += PackageReferenceRemoved;
+ }
+
+ void PackageReferenceRemoved(object sender, PackageOperationEventArgs e)
+ {
+ packagesRemoved.Add(e.Package);
+ }
+
+ public void Dispose()
+ {
+ projectManager.PackageReferenceRemoved -= PackageReferenceRemoved;
+ }
+
+ public List<IPackage> PackagesRemoved {
+ get { return packagesRemoved; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ResolveFileConflictEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ResolveFileConflictEventArgs.cs
new file mode 100644
index 0000000000..97ebae3b1c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ResolveFileConflictEventArgs.cs
@@ -0,0 +1,45 @@
+//
+// ResolveFileConflictEventArgs.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ResolveFileConflictEventArgs : EventArgs
+ {
+ public ResolveFileConflictEventArgs(string message)
+ {
+ this.Message = message;
+ this.Resolution = FileConflictResolution.Ignore;
+ }
+
+ public string Message { get; private set; }
+ public FileConflictResolution Resolution { get; set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsEventArgs.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsEventArgs.cs
new file mode 100644
index 0000000000..444db4e904
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsEventArgs.cs
@@ -0,0 +1,45 @@
+//
+// SelectProjectsEventArgs.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SelectProjectsEventArgs : EventArgs
+ {
+ public SelectProjectsEventArgs(IEnumerable<IPackageManagementSelectedProject> selectedProjects)
+ {
+ this.SelectedProjects = selectedProjects;
+ }
+
+ public IEnumerable<IPackageManagementSelectedProject> SelectedProjects { get; private set; }
+
+ public bool IsAccepted { get; set; }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs
new file mode 100644
index 0000000000..1972cb8a03
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs
@@ -0,0 +1,51 @@
+//
+// SelectProjectsService.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using MonoDevelop.Ide;
+using MonoDevelop.PackageManagement;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SelectProjectsService : ISelectProjectsService
+ {
+ public bool SelectProjects(IEnumerable<IPackageManagementSelectedProject> projects)
+ {
+ SelectProjectsDialog dialog = CreateSelectProjectsDialog(projects);
+ int result = MessageService.ShowCustomDialog(dialog);
+ return result == (int)Gtk.ResponseType.Ok;
+ }
+
+ SelectProjectsDialog CreateSelectProjectsDialog(IEnumerable<IPackageManagementSelectedProject> projects)
+ {
+ var viewModel = new SelectProjectsViewModel(projects);
+ return new SelectProjectsDialog(viewModel);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsViewModel.cs
new file mode 100644
index 0000000000..ee3e00a080
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsViewModel.cs
@@ -0,0 +1,61 @@
+//
+// SelectProjectsViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SelectProjectsViewModel
+ {
+ ObservableCollection<IPackageManagementSelectedProject> projects =
+ new ObservableCollection<IPackageManagementSelectedProject>();
+
+ public SelectProjectsViewModel(IEnumerable<IPackageManagementSelectedProject> projects)
+ {
+ AddProjects(projects);
+ }
+
+ void AddProjects(IEnumerable<IPackageManagementSelectedProject> projects)
+ {
+ foreach (IPackageManagementSelectedProject project in projects) {
+ AddProject(project);
+ }
+ }
+
+ void AddProject(IPackageManagementSelectedProject project)
+ {
+ projects.Add(project);
+ }
+
+ public ObservableCollection<IPackageManagementSelectedProject> Projects {
+ get { return projects; }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForInstalledPackages.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForInstalledPackages.cs
new file mode 100644
index 0000000000..87b968e692
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForInstalledPackages.cs
@@ -0,0 +1,45 @@
+//
+// SelectedProjectsForInstalledPackages.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SelectedProjectsForInstalledPackages : PackageManagementSelectedProjects
+ {
+ public SelectedProjectsForInstalledPackages(IPackageManagementSolution solution)
+ : base(solution)
+ {
+ }
+
+ protected override bool IsProjectSelected(IPackageManagementProject project, IPackageFromRepository package)
+ {
+ return project.IsPackageInstalled(package);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForUpdatedPackages.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForUpdatedPackages.cs
new file mode 100644
index 0000000000..cbbd91ad0d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForUpdatedPackages.cs
@@ -0,0 +1,59 @@
+//
+// SelectedProjectsForUpdatedPackages.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SelectedProjectsForUpdatedPackages : PackageManagementSelectedProjects
+ {
+ public SelectedProjectsForUpdatedPackages(IPackageManagementSolution solution)
+ : base(solution)
+ {
+ }
+
+ protected override bool IsProjectSelected(IPackageManagementProject project, IPackageFromRepository package)
+ {
+ return IsProjectEnabled(project, package);
+ }
+
+ protected override bool IsProjectEnabled(IPackageManagementProject project, IPackageFromRepository package)
+ {
+ return project.GetPackages()
+ .Where(p => IsPackageIdMatch(p.Id, package.Id))
+ .Any(p => p.Version < package.Version);
+ }
+
+ bool IsPackageIdMatch(string id1, string id2)
+ {
+ return String.Equals(id1, id2, StringComparison.InvariantCultureIgnoreCase);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsFactory.cs
new file mode 100644
index 0000000000..9fac0b11d7
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsFactory.cs
@@ -0,0 +1,42 @@
+//
+// SettingsFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SettingsFactory : ISettingsFactory
+ {
+ public ISettings CreateSettings(string directory)
+ {
+ var fileSystem = new PhysicalFileSystem(directory);
+ return new Settings(fileSystem);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManager.cs
new file mode 100644
index 0000000000..e7bdf16cf0
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManager.cs
@@ -0,0 +1,209 @@
+//
+// SharpDevelopPackageManager.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012-2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SharpDevelopPackageManager : PackageManager, ISharpDevelopPackageManager
+ {
+ IProjectSystem projectSystem;
+ IPackageOperationResolverFactory packageOperationResolverFactory;
+
+ public SharpDevelopPackageManager(
+ IPackageRepository sourceRepository,
+ IProjectSystem projectSystem,
+ ISolutionPackageRepository solutionPackageRepository,
+ IPackageOperationResolverFactory packageOperationResolverFactory)
+ : base(
+ sourceRepository,
+ solutionPackageRepository.PackagePathResolver,
+ solutionPackageRepository.FileSystem,
+ solutionPackageRepository.Repository)
+ {
+ this.projectSystem = projectSystem;
+ this.packageOperationResolverFactory = packageOperationResolverFactory;
+ CreateProjectManager();
+ }
+
+ // <summary>
+ /// project manager should be created with:
+ /// local repo = PackageReferenceRepository(projectSystem, sharedRepo)
+ /// packageRefRepo should have its RegisterIfNecessary() method called before creating the project manager.
+ /// source repo = sharedRepository
+ /// </summary>
+ void CreateProjectManager()
+ {
+ var packageRefRepository = CreatePackageReferenceRepository();
+ ProjectManager = CreateProjectManager(packageRefRepository);
+ }
+
+ PackageReferenceRepository CreatePackageReferenceRepository()
+ {
+ var sharedRepository = LocalRepository as ISharedPackageRepository;
+ var packageRefRepository = new PackageReferenceRepository(projectSystem, sharedRepository);
+ packageRefRepository.RegisterIfNecessary();
+ return packageRefRepository;
+ }
+
+ public ISharpDevelopProjectManager ProjectManager { get; set; }
+
+ SharpDevelopProjectManager CreateProjectManager(PackageReferenceRepository packageRefRepository)
+ {
+ return new SharpDevelopProjectManager(LocalRepository, PathResolver, projectSystem, packageRefRepository);
+ }
+
+ public void InstallPackage(IPackage package)
+ {
+ bool ignoreDependencies = false;
+ bool allowPreleaseVersions = false;
+ InstallPackage(package, ignoreDependencies, allowPreleaseVersions);
+ }
+
+ public void InstallPackage(IPackage package, InstallPackageAction installAction)
+ {
+ RunPackageOperations(installAction.Operations);
+ AddPackageReference(package, installAction.IgnoreDependencies, installAction.AllowPrereleaseVersions);
+ }
+
+ void AddPackageReference(IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
+ {
+ var monitor = new RemovedPackageReferenceMonitor(ProjectManager);
+ using (monitor) {
+ ProjectManager.AddPackageReference(package.Id, package.Version, ignoreDependencies, allowPrereleaseVersions);
+ }
+
+ monitor.PackagesRemoved.ForEach(packageRemoved => UninstallPackageFromSolutionRepository(packageRemoved));
+ }
+
+ public override void InstallPackage(IPackage package, bool ignoreDependencies, bool allowPrereleaseVersions)
+ {
+ base.InstallPackage(package, ignoreDependencies, allowPrereleaseVersions);
+ AddPackageReference(package, ignoreDependencies, allowPrereleaseVersions);
+ }
+
+ public void UninstallPackage(IPackage package, UninstallPackageAction uninstallAction)
+ {
+ UninstallPackage(package, uninstallAction.ForceRemove, uninstallAction.RemoveDependencies);
+ }
+
+ public override void UninstallPackage(IPackage package, bool forceRemove, bool removeDependencies)
+ {
+ ProjectManager.RemovePackageReference(package.Id, forceRemove, removeDependencies);
+ if (!IsPackageReferencedByOtherProjects(package)) {
+ base.UninstallPackage(package, forceRemove, removeDependencies);
+ }
+ }
+
+ public void UninstallPackageFromSolutionRepository(IPackage package)
+ {
+ if (!IsPackageReferencedByOtherProjects(package)) {
+ ExecuteUninstall(package);
+ }
+ }
+
+ bool IsPackageReferencedByOtherProjects(IPackage package)
+ {
+ var sharedRepository = LocalRepository as ISharedPackageRepository;
+ return sharedRepository.IsReferenced(package.Id, package.Version);
+ }
+
+ public IEnumerable<PackageOperation> GetInstallPackageOperations(IPackage package, InstallPackageAction installAction)
+ {
+ IPackageOperationResolver resolver = CreateInstallPackageOperationResolver(installAction);
+ return resolver.ResolveOperations(package);
+ }
+
+ IPackageOperationResolver CreateInstallPackageOperationResolver(InstallPackageAction installAction)
+ {
+ return packageOperationResolverFactory.CreateInstallPackageOperationResolver(
+ LocalRepository,
+ SourceRepository,
+ Logger,
+ installAction);
+ }
+
+ public void UpdatePackage(IPackage package, UpdatePackageAction updateAction)
+ {
+ RunPackageOperations(updateAction.Operations);
+ UpdatePackageReference(package, updateAction);
+ }
+
+ public void UpdatePackageReference(IPackage package, IUpdatePackageSettings settings)
+ {
+ UpdatePackageReference(package, settings.UpdateDependencies, settings.AllowPrereleaseVersions);
+ }
+
+ void UpdatePackageReference(IPackage package, bool updateDependencies, bool allowPrereleaseVersions)
+ {
+ var monitor = new RemovedPackageReferenceMonitor(ProjectManager);
+ using (monitor) {
+ ProjectManager.UpdatePackageReference(package.Id, package.Version, updateDependencies, allowPrereleaseVersions);
+ }
+
+ monitor.PackagesRemoved.ForEach(packageRemoved => UninstallPackageFromSolutionRepository(packageRemoved));
+ }
+
+ public void UpdatePackages(UpdatePackagesAction updateAction)
+ {
+ RunPackageOperations(updateAction.Operations);
+ foreach (IPackage package in updateAction.Packages) {
+ UpdatePackageReference(package, updateAction);
+ }
+ }
+
+ public IEnumerable<PackageOperation> GetUpdatePackageOperations(
+ IEnumerable<IPackage> packages,
+ IUpdatePackageSettings settings)
+ {
+ IPackageOperationResolver resolver = CreateUpdatePackageOperationResolver(settings);
+
+ var reducedOperations = new ReducedPackageOperations(resolver, packages);
+ reducedOperations.Reduce();
+ return reducedOperations.Operations;
+ }
+
+ IPackageOperationResolver CreateUpdatePackageOperationResolver(IUpdatePackageSettings settings)
+ {
+ return packageOperationResolverFactory.CreateUpdatePackageOperationResolver(
+ LocalRepository,
+ SourceRepository,
+ Logger,
+ settings);
+ }
+
+ public void RunPackageOperations(IEnumerable<PackageOperation> operations)
+ {
+ foreach (PackageOperation operation in operations) {
+ Execute(operation);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManagerFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManagerFactory.cs
new file mode 100644
index 0000000000..4f5d627629
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageManagerFactory.cs
@@ -0,0 +1,83 @@
+//
+// SharpDevelopPackageManagerFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SharpDevelopPackageManagerFactory : IPackageManagerFactory
+ {
+ PackageManagementOptions options;
+ ISharpDevelopPackageRepositoryFactory packageRepositoryFactory;
+ ISharpDevelopProjectSystemFactory projectSystemFactory;
+
+ public SharpDevelopPackageManagerFactory()
+ : this(
+ new SharpDevelopPackageRepositoryFactory(),
+ new SharpDevelopProjectSystemFactory(),
+ new PackageManagementOptions())
+ {
+ }
+
+ public SharpDevelopPackageManagerFactory(
+ ISharpDevelopPackageRepositoryFactory packageRepositoryFactory,
+ ISharpDevelopProjectSystemFactory projectSystemFactory,
+ PackageManagementOptions options)
+ {
+ this.packageRepositoryFactory = packageRepositoryFactory;
+ this.projectSystemFactory = projectSystemFactory;
+ this.options = options;
+ }
+
+ public ISharpDevelopPackageManager CreatePackageManager(
+ IPackageRepository sourceRepository,
+ DotNetProject project)
+ {
+ SolutionPackageRepository solutionPackageRepository = CreateSolutionPackageRepository(project.ParentSolution);
+ IProjectSystem projectSystem = CreateProjectSystem(project);
+ PackageOperationsResolverFactory packageOperationResolverFactory = new PackageOperationsResolverFactory();
+
+ return new SharpDevelopPackageManager(
+ sourceRepository,
+ projectSystem,
+ solutionPackageRepository,
+ packageOperationResolverFactory);
+ }
+
+ SolutionPackageRepository CreateSolutionPackageRepository(Solution solution)
+ {
+ return new SolutionPackageRepository(solution, packageRepositoryFactory, options);
+ }
+
+ IProjectSystem CreateProjectSystem(DotNetProject project)
+ {
+ return projectSystemFactory.CreateProjectSystem(project);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageRepositoryFactory.cs
new file mode 100644
index 0000000000..ae396a290a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopPackageRepositoryFactory.cs
@@ -0,0 +1,69 @@
+//
+// SharpDevelopPackageRepositoryFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SharpDevelopPackageRepositoryFactory : PackageRepositoryFactory, ISharpDevelopPackageRepositoryFactory
+ {
+ IPackageManagementEvents packageManagementEvents;
+
+ public SharpDevelopPackageRepositoryFactory()
+ : this(PackageManagementServices.PackageManagementEvents)
+ {
+ }
+
+ public SharpDevelopPackageRepositoryFactory(IPackageManagementEvents packageManagementEvents)
+ {
+ this.packageManagementEvents = packageManagementEvents;
+ }
+
+ public ISharedPackageRepository CreateSharedRepository(
+ IPackagePathResolver pathResolver,
+ IFileSystem fileSystem,
+ IFileSystem configSettingsFileSystem)
+ {
+ return new SharedPackageRepository(pathResolver, fileSystem, configSettingsFileSystem);
+ }
+
+ public IRecentPackageRepository CreateRecentPackageRepository(
+ IList<RecentPackageInfo> recentPackages,
+ IPackageRepository aggregateRepository)
+ {
+ return new RecentPackageRepository(recentPackages, aggregateRepository, packageManagementEvents);
+ }
+
+ public IPackageRepository CreateAggregateRepository(IEnumerable<IPackageRepository> repositories)
+ {
+ return new AggregateRepository(repositories);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectManager.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectManager.cs
new file mode 100644
index 0000000000..a1015e0d94
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectManager.cs
@@ -0,0 +1,57 @@
+//
+// SharpDevelopProjectManager.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SharpDevelopProjectManager : ProjectManager, ISharpDevelopProjectManager
+ {
+ public SharpDevelopProjectManager(
+ IPackageRepository sourceRepository,
+ IPackagePathResolver pathResolver,
+ IProjectSystem project,
+ IPackageRepository localRepository)
+ : base(sourceRepository, pathResolver, project, localRepository)
+ {
+ }
+
+ public bool IsInstalled(string packageId)
+ {
+ return LocalRepository.Exists(packageId);
+ }
+
+ public bool HasOlderPackageInstalled(IPackage package)
+ {
+ IPackage installedPackage = LocalRepository.FindPackage(package.Id);
+ return (installedPackage != null) &&
+ (installedPackage.Version < package.Version);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystem.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystem.cs
new file mode 100644
index 0000000000..41b273930e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystem.cs
@@ -0,0 +1,371 @@
+//
+// SharpDevelopProjectSystem.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Runtime.Versioning;
+
+using MonoDevelop.Core;
+using MonoDevelop.PackageManagement;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SharpDevelopProjectSystem : PhysicalFileSystem, IProjectSystem
+ {
+ DotNetProject project;
+ ProjectTargetFramework targetFramework;
+ IPackageManagementFileService fileService;
+ IPackageManagementProjectService projectService;
+
+ public SharpDevelopProjectSystem(DotNetProject project)
+ : this(project, new PackageManagementFileService(), new PackageManagementProjectService())
+ {
+ }
+
+ public SharpDevelopProjectSystem(
+ DotNetProject project,
+ IPackageManagementFileService fileService,
+ IPackageManagementProjectService projectService)
+ : base(AppendTrailingSlashToDirectory(project.BaseDirectory))
+ {
+ this.project = project;
+ this.fileService = fileService;
+ this.projectService = projectService;
+ }
+
+ static string AppendTrailingSlashToDirectory(string directory)
+ {
+ return directory + Path.DirectorySeparatorChar.ToString();
+ }
+
+ public bool IsBindingRedirectSupported { get; set; }
+
+ public FrameworkName TargetFramework {
+ get { return GetTargetFramework(); }
+ }
+
+ FrameworkName GetTargetFramework()
+ {
+ if (targetFramework == null) {
+ targetFramework = new ProjectTargetFramework(project);
+ }
+ return targetFramework.TargetFrameworkName;
+ }
+
+ public string ProjectName {
+ get { return project.Name; }
+ }
+
+ public dynamic GetPropertyValue(string propertyName)
+ {
+ return project.GetEvaluatedProperty(propertyName);
+ }
+
+ public void AddReference(string referencePath, Stream stream)
+ {
+ ProjectReference assemblyReference = CreateReference(referencePath);
+ AddReferenceToProject(assemblyReference);
+ }
+
+ ProjectReference CreateReference(string referencePath)
+ {
+ string fullPath = GetFullPath(referencePath);
+ return new ProjectReference(ReferenceType.Assembly, fullPath);
+ }
+
+ void AddReferenceToProject(ProjectReference assemblyReference)
+ {
+ project.References.Add(assemblyReference);
+ projectService.Save(project);
+ LogAddedReferenceToProject(assemblyReference);
+ }
+
+ void LogAddedReferenceToProject(ProjectReference referenceProjectItem)
+ {
+ LogAddedReferenceToProject(referenceProjectItem.Reference, ProjectName);
+ }
+
+ protected virtual void LogAddedReferenceToProject(string referenceName, string projectName)
+ {
+ DebugLogFormat("Added reference '{0}' to project '{1}'.", referenceName, projectName);
+ }
+
+ void DebugLogFormat(string format, params object[] args)
+ {
+ Logger.Log(MessageLevel.Debug, format, args);
+ }
+
+ public bool ReferenceExists(string name)
+ {
+ ProjectReference referenceProjectItem = FindReference(name);
+ if (referenceProjectItem != null) {
+ return true;
+ }
+ return false;
+ }
+
+ ProjectReference FindReference(string name)
+ {
+ string referenceName = GetReferenceName(name);
+ foreach (ProjectReference referenceProjectItem in project.References) {
+ string projectReferenceName = GetProjectReferenceName(referenceProjectItem.Reference);
+ if (IsMatchIgnoringCase(projectReferenceName, referenceName)) {
+ return referenceProjectItem;
+ }
+ }
+ return null;
+ }
+
+ string GetReferenceName(string name)
+ {
+ if (HasDllOrExeFileExtension(name)) {
+ return Path.GetFileNameWithoutExtension(name);
+ }
+ return name;
+ }
+
+ string GetProjectReferenceName(string name)
+ {
+ string referenceName = GetReferenceName(name);
+ return GetAssemblyShortName(referenceName);
+ }
+
+ string GetAssemblyShortName(string name)
+ {
+ string[] parts = name.Split(',');
+ return parts[0];
+ }
+
+ bool HasDllOrExeFileExtension(string name)
+ {
+ string extension = Path.GetExtension(name);
+ return
+ IsMatchIgnoringCase(extension, ".dll") ||
+ IsMatchIgnoringCase(extension, ".exe");
+ }
+
+ bool IsMatchIgnoringCase(string lhs, string rhs)
+ {
+ return String.Equals(lhs, rhs, StringComparison.InvariantCultureIgnoreCase);
+ }
+
+ public void RemoveReference(string name)
+ {
+ ProjectReference referenceProjectItem = FindReference(name);
+ if (referenceProjectItem != null) {
+ project.References.Remove(referenceProjectItem);
+ projectService.Save(project);
+ LogRemovedReferenceFromProject(referenceProjectItem);
+ }
+ }
+
+ void LogRemovedReferenceFromProject(ProjectReference referenceProjectItem)
+ {
+ LogRemovedReferenceFromProject(referenceProjectItem.Reference, ProjectName);
+ }
+
+ protected virtual void LogRemovedReferenceFromProject(string referenceName, string projectName)
+ {
+ DebugLogFormat("Removed reference '{0}' from project '{1}'.", referenceName, projectName);
+ }
+
+ public bool IsSupportedFile(string path)
+ {
+ if (project.IsWebProject()) {
+ return !IsAppConfigFile(path);
+ }
+ return !IsWebConfigFile(path);
+ }
+
+ bool IsWebConfigFile(string path)
+ {
+ return IsFileNameMatchIgnoringPath("web.config", path);
+ }
+
+ bool IsAppConfigFile(string path)
+ {
+ return IsFileNameMatchIgnoringPath("app.config", path);
+ }
+
+ bool IsFileNameMatchIgnoringPath(string fileName1, string path)
+ {
+ string fileName2 = Path.GetFileName(path);
+ return IsMatchIgnoringCase(fileName1, fileName2);
+ }
+
+ public override void AddFile(string path, Stream stream)
+ {
+ PhysicalFileSystemAddFile(path, stream);
+ AddFileToProject(path);
+ }
+
+ protected virtual void PhysicalFileSystemAddFile(string path, Stream stream)
+ {
+ base.AddFile(path, stream);
+ }
+
+ public override void AddFile(string path, Action<Stream> writeToStream)
+ {
+ base.AddFile(path, writeToStream);
+ AddFileToProject(path);
+ }
+
+ void AddFileToProject(string path)
+ {
+ if (ShouldAddFileToProject(path)) {
+ AddFileProjectItemToProject(path);
+ }
+ LogAddedFileToProject(path);
+ }
+
+ bool ShouldAddFileToProject(string path)
+ {
+ return !IsBinDirectory(path) && !FileExistsInProject(path);
+ }
+
+ bool IsBinDirectory(string path)
+ {
+ string directoryName = Path.GetDirectoryName(path);
+ return IsMatchIgnoringCase(directoryName, "bin");
+ }
+
+ public bool FileExistsInProject(string path)
+ {
+ string fullPath = GetFullPath(path);
+ return project.IsFileInProject(fullPath);
+ }
+
+ void AddFileProjectItemToProject(string path)
+ {
+ ProjectFile fileItem = CreateFileProjectItem(path);
+ project.AddFile(fileItem);
+ projectService.Save(project);
+ }
+
+ ProjectFile CreateFileProjectItem(string path)
+ {
+ //TODO custom tool?
+ string fullPath = GetFullPath(path);
+ string buildAction = project.GetDefaultBuildAction(fullPath);
+ return new ProjectFile(fullPath) {
+ BuildAction = buildAction
+ };
+ }
+
+ void LogAddedFileToProject(string fileName)
+ {
+ LogAddedFileToProject(fileName, ProjectName);
+ }
+
+ protected virtual void LogAddedFileToProject(string fileName, string projectName)
+ {
+ DebugLogFormat("Added file '{0}' to project '{1}'.", fileName, projectName);
+ }
+
+ public override void DeleteDirectory(string path, bool recursive)
+ {
+ string directory = GetFullPath(path);
+ fileService.RemoveDirectory(directory);
+ projectService.Save(project);
+ LogDeletedDirectory(path);
+ }
+
+ public override void DeleteFile(string path)
+ {
+ string fileName = GetFullPath(path);
+ project.Files.Remove(fileName);
+ fileService.RemoveFile(fileName);
+ projectService.Save(project);
+ LogDeletedFileInfo(path);
+ }
+
+ protected virtual void LogDeletedDirectory(string folder)
+ {
+ DebugLogFormat("Removed folder '{0}'.", folder);
+ }
+
+ void LogDeletedFileInfo(string path)
+ {
+ string fileName = Path.GetFileName(path);
+ string directory = Path.GetDirectoryName(path);
+ if (String.IsNullOrEmpty(directory)) {
+ LogDeletedFile(fileName);
+ } else {
+ LogDeletedFileFromDirectory(fileName, directory);
+ }
+ }
+
+ protected virtual void LogDeletedFile(string fileName)
+ {
+ DebugLogFormat("Removed file '{0}'.", fileName);
+ }
+
+ protected virtual void LogDeletedFileFromDirectory(string fileName, string directory)
+ {
+ DebugLogFormat("Removed file '{0}' from folder '{1}'.", fileName, directory);
+ }
+
+ public void AddFrameworkReference(string name)
+ {
+ ProjectReference assemblyReference = CreateGacReference(name);
+ AddReferenceToProject(assemblyReference);
+ }
+
+ ProjectReference CreateGacReference(string name)
+ {
+ return new ProjectReference(ReferenceType.Package, name);
+ }
+
+ public string ResolvePath(string path)
+ {
+ return path;
+ }
+
+ public void AddImport(string targetPath, ProjectImportLocation location)
+ {
+ string relativeTargetPath = GetRelativePath(targetPath);
+ project.AddImportIfMissing(relativeTargetPath, location);
+ projectService.Save(project);
+ }
+
+ string GetRelativePath(string path)
+ {
+ return FileService.AbsoluteToRelativePath(project.BaseDirectory, path);
+ }
+
+ public void RemoveImport(string targetPath)
+ {
+ string relativeTargetPath = GetRelativePath(targetPath);
+ project.RemoveImport(relativeTargetPath);
+ projectService.Save(project);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystemFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystemFactory.cs
new file mode 100644
index 0000000000..5faa892bd2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystemFactory.cs
@@ -0,0 +1,42 @@
+//
+// SharpDevelopProjectSystemFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SharpDevelopProjectSystemFactory : ISharpDevelopProjectSystemFactory
+ {
+ public IProjectSystem CreateProjectSystem(DotNetProject project)
+ {
+ return new SharpDevelopProjectSystem(project);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionExtensions.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionExtensions.cs
new file mode 100644
index 0000000000..bc4bf57585
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionExtensions.cs
@@ -0,0 +1,42 @@
+//
+// SolutionExtensions.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Projects;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class SolutionExtensions
+ {
+ public static void Save(this Solution solution)
+ {
+ solution.Save(new NullProgressMonitor());
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepository.cs
new file mode 100644
index 0000000000..e6cb4013e5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepository.cs
@@ -0,0 +1,119 @@
+//
+// SolutionPackageRepository.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SolutionPackageRepository : ISolutionPackageRepository
+ {
+ SolutionPackageRepositoryPath repositoryPath;
+ ISharpDevelopPackageRepositoryFactory repositoryFactory;
+ DefaultPackagePathResolver packagePathResolver;
+ PhysicalFileSystem fileSystem;
+ ISharedPackageRepository repository;
+
+ public SolutionPackageRepository(Solution solution)
+ : this(
+ solution,
+ new SharpDevelopPackageRepositoryFactory(),
+ PackageManagementServices.Options)
+ {
+ }
+
+ public SolutionPackageRepository(
+ Solution solution,
+ ISharpDevelopPackageRepositoryFactory repositoryFactory,
+ PackageManagementOptions options)
+ {
+ this.repositoryFactory = repositoryFactory;
+ repositoryPath = new SolutionPackageRepositoryPath(solution, options);
+ CreatePackagePathResolver();
+ CreateFileSystem();
+ CreateRepository(ConfigSettingsFileSystem.CreateConfigSettingsFileSystem(solution));
+ }
+
+ void CreatePackagePathResolver()
+ {
+ packagePathResolver = new DefaultPackagePathResolver(repositoryPath.PackageRepositoryPath);
+ }
+
+ void CreateFileSystem()
+ {
+ fileSystem = new PhysicalFileSystem(repositoryPath.PackageRepositoryPath);
+ }
+
+ void CreateRepository(ConfigSettingsFileSystem configSettingsFileSystem)
+ {
+ repository = repositoryFactory.CreateSharedRepository(packagePathResolver, fileSystem, configSettingsFileSystem);
+ }
+
+ public ISharedPackageRepository Repository {
+ get { return repository; }
+ }
+
+ public IFileSystem FileSystem {
+ get { return fileSystem; }
+ }
+
+ public IPackagePathResolver PackagePathResolver {
+ get { return packagePathResolver; }
+ }
+
+ public string GetInstallPath(IPackage package)
+ {
+ return repositoryPath.GetInstallPath(package);
+ }
+
+ public IEnumerable<IPackage> GetPackagesByDependencyOrder()
+ {
+ var packageSorter = new PackageSorter(null);
+ return packageSorter.GetPackagesByDependencyOrder(repository);
+ }
+
+ public IEnumerable<IPackage> GetPackagesByReverseDependencyOrder()
+ {
+ return GetPackagesByDependencyOrder().Reverse();
+ }
+
+ public bool IsInstalled(IPackage package)
+ {
+ return repository.Exists(package);
+ }
+
+ public IQueryable<IPackage> GetPackages()
+ {
+ return repository.GetPackages();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryFactory.cs
new file mode 100644
index 0000000000..9ac4dca212
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryFactory.cs
@@ -0,0 +1,58 @@
+//
+// SolutionPackageRepositoryFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SolutionPackageRepositoryFactory : ISolutionPackageRepositoryFactory
+ {
+ ISharpDevelopPackageRepositoryFactory repositoryFactory;
+ PackageManagementOptions options;
+
+ public SolutionPackageRepositoryFactory()
+ : this(PackageManagementServices.PackageRepositoryCache, PackageManagementServices.Options)
+ {
+ }
+
+ public SolutionPackageRepositoryFactory(
+ ISharpDevelopPackageRepositoryFactory repositoryFactory,
+ PackageManagementOptions options)
+ {
+ this.repositoryFactory = repositoryFactory;
+ this.options = options;
+ }
+
+ public ISolutionPackageRepository CreateSolutionPackageRepository(Solution solution)
+ {
+ return new SolutionPackageRepository(solution, repositoryFactory, options);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryPath.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryPath.cs
new file mode 100644
index 0000000000..6daca5784d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryPath.cs
@@ -0,0 +1,72 @@
+//
+// SolutionPackageRepositoryPath.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using MonoDevelop.Projects;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class SolutionPackageRepositoryPath
+ {
+ string packagesRelativeDirectory;
+ Solution solution;
+ DefaultPackagePathResolver pathResolver;
+
+ public SolutionPackageRepositoryPath(Project project)
+ : this(project, new PackageManagementOptions())
+ {
+ }
+
+ public SolutionPackageRepositoryPath(Project project, PackageManagementOptions options)
+ : this(project.ParentSolution, options)
+ {
+ }
+
+ public SolutionPackageRepositoryPath(Solution solution, PackageManagementOptions options)
+ {
+ packagesRelativeDirectory = options.PackagesDirectory;
+ this.solution = solution;
+ GetSolutionPackageRepositoryPath();
+ }
+
+ void GetSolutionPackageRepositoryPath()
+ {
+ PackageRepositoryPath = Path.Combine(solution.BaseDirectory, packagesRelativeDirectory);
+ }
+
+ public string PackageRepositoryPath { get; private set; }
+
+ public string GetInstallPath(IPackage package)
+ {
+ pathResolver = new DefaultPackagePathResolver(PackageRepositoryPath);
+ return pathResolver.GetInstallPath(package);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafePackageManagementEvents.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafePackageManagementEvents.cs
new file mode 100644
index 0000000000..29c06afdc5
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafePackageManagementEvents.cs
@@ -0,0 +1,207 @@
+//
+// ThreadSafePackageManagementEvents.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ //TODO use UI thread.
+ public class ThreadSafePackageManagementEvents : IThreadSafePackageManagementEvents
+ {
+ IPackageManagementEvents unsafeEvents;
+
+ public ThreadSafePackageManagementEvents(IPackageManagementEvents unsafeEvents)
+ {
+ this.unsafeEvents = unsafeEvents;
+
+ RegisterEventHandlers();
+ }
+
+ void RegisterEventHandlers()
+ {
+ unsafeEvents.PackageOperationsStarting += RaisePackageOperationStartingEventIfHasSubscribers;
+ unsafeEvents.PackageOperationError += RaisePackageOperationErrorEventIfHasSubscribers;
+ unsafeEvents.ParentPackageInstalled += RaiseParentPackageInstalledEventIfHasSubscribers;
+ unsafeEvents.ParentPackageUninstalled += RaiseParentPackageUninstalledEventIfHasSubscribers;
+ unsafeEvents.ParentPackagesUpdated += RaiseParentPackagesUpdatedEventIfHasSubscribers;
+ }
+
+ public void Dispose()
+ {
+ UnregisterEventHandlers();
+ }
+
+ void UnregisterEventHandlers()
+ {
+ unsafeEvents.PackageOperationsStarting -= RaisePackageOperationStartingEventIfHasSubscribers;
+ unsafeEvents.PackageOperationError -= RaisePackageOperationErrorEventIfHasSubscribers;
+ unsafeEvents.ParentPackageInstalled -= RaiseParentPackageInstalledEventIfHasSubscribers;
+ unsafeEvents.ParentPackageUninstalled -= RaiseParentPackageUninstalledEventIfHasSubscribers;
+ unsafeEvents.ParentPackagesUpdated -= RaiseParentPackagesUpdatedEventIfHasSubscribers;
+ }
+
+ void RaisePackageOperationStartingEventIfHasSubscribers(object sender, EventArgs e)
+ {
+ if (PackageOperationsStarting != null) {
+ RaisePackageOperationStartingEvent(sender, e);
+ }
+ }
+
+ void RaisePackageOperationStartingEvent(object sender, EventArgs e)
+ {
+ PackageOperationsStarting(sender, e);
+ }
+
+ public event EventHandler PackageOperationsStarting;
+
+ void RaisePackageOperationErrorEventIfHasSubscribers(object sender, PackageOperationExceptionEventArgs e)
+ {
+ if (PackageOperationError != null) {
+ RaisePackageOperationErrorEvent(sender, e);
+ }
+ }
+
+ void RaisePackageOperationErrorEvent(object sender, PackageOperationExceptionEventArgs e)
+ {
+ if (PackageOperationError != null) {
+ PackageOperationError(sender, e);
+ }
+ }
+
+ public event EventHandler<PackageOperationExceptionEventArgs> PackageOperationError;
+
+ void RaiseParentPackageInstalledEventIfHasSubscribers(object sender, ParentPackageOperationEventArgs e)
+ {
+ if (ParentPackageInstalled != null) {
+ RaiseParentPackageInstalledEvent(sender, e);
+ }
+ }
+
+ void RaiseParentPackageInstalledEvent(object sender, ParentPackageOperationEventArgs e)
+ {
+ ParentPackageInstalled(sender, e);
+ }
+
+ public event EventHandler<ParentPackageOperationEventArgs> ParentPackageInstalled;
+
+ void RaiseParentPackageUninstalledEventIfHasSubscribers(object sender, ParentPackageOperationEventArgs e)
+ {
+ if (ParentPackageUninstalled != null) {
+ RaiseParentPackageUninstalledEvent(sender, e);
+ }
+ }
+
+ void RaiseParentPackageUninstalledEvent(object sender, ParentPackageOperationEventArgs e)
+ {
+ ParentPackageUninstalled(sender, e);
+ }
+
+ public event EventHandler<ParentPackageOperationEventArgs> ParentPackageUninstalled;
+
+ public event EventHandler<AcceptLicensesEventArgs> AcceptLicenses {
+ add { unsafeEvents.AcceptLicenses += value; }
+ remove { unsafeEvents.AcceptLicenses -= value; }
+ }
+
+ public event EventHandler<PackageOperationMessageLoggedEventArgs> PackageOperationMessageLogged {
+ add { unsafeEvents.PackageOperationMessageLogged += value; }
+ remove { unsafeEvents.PackageOperationMessageLogged -= value; }
+ }
+
+ public event EventHandler<SelectProjectsEventArgs> SelectProjects {
+ add { unsafeEvents.SelectProjects += value; }
+ remove { unsafeEvents.SelectProjects -= value; }
+ }
+
+ public void OnPackageOperationsStarting()
+ {
+ unsafeEvents.OnPackageOperationsStarting();
+ }
+
+ public void OnPackageOperationError(Exception ex)
+ {
+ unsafeEvents.OnPackageOperationError(ex);
+ }
+
+ public bool OnAcceptLicenses(IEnumerable<IPackage> packages)
+ {
+ return unsafeEvents.OnAcceptLicenses(packages);
+ }
+
+ public void OnParentPackageInstalled(IPackage package)
+ {
+ unsafeEvents.OnParentPackageInstalled(package);
+ }
+
+ public void OnParentPackageUninstalled(IPackage package)
+ {
+ unsafeEvents.OnParentPackageUninstalled(package);
+ }
+
+ public void OnPackageOperationMessageLogged(MessageLevel level, string message, params object[] args)
+ {
+ unsafeEvents.OnPackageOperationMessageLogged(level, message, args);
+ }
+
+ public bool OnSelectProjects(IEnumerable<IPackageManagementSelectedProject> selectedProjects)
+ {
+ return unsafeEvents.OnSelectProjects(selectedProjects);
+ }
+
+ public event EventHandler<ResolveFileConflictEventArgs> ResolveFileConflict {
+ add { unsafeEvents.ResolveFileConflict += value; }
+ remove { unsafeEvents.ResolveFileConflict -= value; }
+ }
+
+ public FileConflictResolution OnResolveFileConflict(string message)
+ {
+ return unsafeEvents.OnResolveFileConflict(message);
+ }
+
+ public event EventHandler<ParentPackagesOperationEventArgs> ParentPackagesUpdated;
+
+ public void OnParentPackagesUpdated(IEnumerable<IPackage> packages)
+ {
+ unsafeEvents.OnParentPackagesUpdated(packages);
+ }
+
+ void RaiseParentPackagesUpdatedEventIfHasSubscribers(object sender, ParentPackagesOperationEventArgs e)
+ {
+ if (ParentPackagesUpdated != null) {
+ RaiseParentPackagesUpdatedEvent(sender, e);
+ }
+ }
+
+ void RaiseParentPackagesUpdatedEvent(object sender, ParentPackagesOperationEventArgs e)
+ {
+ ParentPackagesUpdated(sender, e);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafeProjectBrowserUpdater.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafeProjectBrowserUpdater.cs
new file mode 100644
index 0000000000..85e6475974
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafeProjectBrowserUpdater.cs
@@ -0,0 +1,54 @@
+//
+// ThreadSafeProjectBrowserUpdater.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class ThreadSafeProjectBrowserUpdater : ProjectBrowserUpdater
+ {
+// public ThreadSafeProjectBrowserUpdater()
+// : base(GetProjectBrowserControl())
+// {
+// }
+//
+// static ProjectBrowserControl GetProjectBrowserControl()
+// {
+// if (WorkbenchSingleton.InvokeRequired) {
+// return WorkbenchSingleton.SafeThreadFunction(() => GetProjectBrowserControl());
+// } else {
+// return ProjectBrowserPad.Instance.ProjectBrowserControl;
+// }
+// }
+//
+// protected override void ProjectItemAdded(object sender, ProjectItemEventArgs e)
+// {
+// WorkbenchSingleton.SafeThreadAsyncCall(() => base.ProjectItemAdded(sender, e));
+// }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs
new file mode 100644
index 0000000000..db4e691688
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs
@@ -0,0 +1,65 @@
+//
+// UninstallPackageAction.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2012 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.IO;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class UninstallPackageAction : ProcessPackageAction
+ {
+ public UninstallPackageAction(
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents)
+ : base(project, packageManagementEvents)
+ {
+ this.AllowPrereleaseVersions = true;
+ }
+
+ public bool ForceRemove { get; set; }
+ public bool RemoveDependencies { get; set; }
+
+ protected override void BeforeExecute()
+ {
+ base.BeforeExecute();
+ }
+
+ protected override void ExecuteCore()
+ {
+ Project.UninstallPackage(Package, this);
+ OnParentPackageUninstalled();
+ }
+
+ public override bool HasPackageScriptsToRun()
+ {
+ var files = new PackageFiles(Package);
+ return files.HasUninstallPackageScript();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs
new file mode 100644
index 0000000000..60861dc86a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackageAction.cs
@@ -0,0 +1,73 @@
+//
+// UpdatePackageAction.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class UpdatePackageAction : ProcessPackageOperationsAction, IUpdatePackageSettings
+ {
+ public UpdatePackageAction(
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents)
+ : base(project, packageManagementEvents)
+ {
+ UpdateDependencies = true;
+ UpdateIfPackageDoesNotExistInProject = true;
+ }
+
+ public bool UpdateDependencies { get; set; }
+ public bool UpdateIfPackageDoesNotExistInProject { get; set; }
+
+ protected override IEnumerable<PackageOperation> GetPackageOperations()
+ {
+ var installAction = Project.CreateInstallPackageAction();
+ installAction.AllowPrereleaseVersions = AllowPrereleaseVersions;
+ installAction.IgnoreDependencies = !UpdateDependencies;
+ return Project.GetInstallPackageOperations(Package, installAction);
+ }
+
+ protected override void ExecuteCore()
+ {
+ if (ShouldUpdatePackage()) {
+ Project.UpdatePackage(Package, this);
+ OnParentPackageInstalled();
+ }
+ }
+
+ bool ShouldUpdatePackage()
+ {
+ if (!UpdateIfPackageDoesNotExistInProject) {
+ return PackageIdExistsInProject();
+ }
+ return true;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesAction.cs
new file mode 100644
index 0000000000..7827037bfb
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesAction.cs
@@ -0,0 +1,114 @@
+//
+// UpdatePackagesAction.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class UpdatePackagesAction : IUpdatePackagesAction
+ {
+ List<IPackage> packages = new List<IPackage>();
+ List<PackageOperation> operations = new List<PackageOperation>();
+ IPackageManagementEvents packageManagementEvents;
+
+ public UpdatePackagesAction(
+ IPackageManagementProject project,
+ IPackageManagementEvents packageManagementEvents)
+ {
+ Project = project;
+ this.packageManagementEvents = packageManagementEvents;
+ UpdateDependencies = true;
+ }
+
+ public IPackageManagementProject Project { get; private set; }
+
+ public IEnumerable<IPackage> Packages {
+ get { return packages; }
+ }
+
+ public IEnumerable<PackageOperation> Operations {
+ get { return operations; }
+ }
+
+ public bool UpdateDependencies { get; set; }
+ public bool AllowPrereleaseVersions { get; set; }
+ public ILogger Logger { get; set; }
+
+ public bool HasPackageScriptsToRun()
+ {
+ var files = new PackageFilesForOperations(Operations);
+ return files.HasAnyPackageScripts();
+ }
+
+ public void AddOperations(IEnumerable<PackageOperation> operations)
+ {
+ this.operations.AddRange(operations);
+ }
+
+ public void AddPackages(IEnumerable<IPackageFromRepository> packages)
+ {
+ this.packages.AddRange(packages);
+ }
+
+ public void Execute()
+ {
+ //if (PackageScriptRunner != null) {
+ // ExecuteWithScriptRunner();
+ //} else {
+ ExecuteCore();
+ //}
+ }
+
+ protected virtual void ExecuteCore()
+ {
+ Project.UpdatePackages(this);
+ packageManagementEvents.OnParentPackagesUpdated(Packages);
+ }
+
+// void ExecuteWithScriptRunner()
+// {
+// using (RunPackageScriptsAction runScriptsAction = CreateRunPackageScriptsAction()) {
+// ExecuteCore();
+// }
+// }
+//
+// RunPackageScriptsAction CreateRunPackageScriptsAction()
+// {
+// return CreateRunPackageScriptsAction(PackageScriptRunner, Project);
+// }
+//
+// protected virtual RunPackageScriptsAction CreateRunPackageScriptsAction(
+// IPackageScriptRunner scriptRunner,
+// IPackageManagementProject project)
+// {
+// return new RunPackageScriptsAction(scriptRunner, project);
+// }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesActionFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesActionFactory.cs
new file mode 100644
index 0000000000..ab1a290391
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatePackagesActionFactory.cs
@@ -0,0 +1,97 @@
+//
+// UpdatePackagesActionFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class UpdatePackagesActionFactory
+ {
+ ILogger logger;
+ IPackageManagementEvents packageManagementEvents;
+ bool singleProjectSelected;
+ IPackageManagementProject project;
+ PackageManagementSelectedProjects selectedProjects;
+ IEnumerable<IPackageFromRepository> packages;
+
+ public UpdatePackagesActionFactory(ILogger logger, IPackageManagementEvents packageManagementEvents)
+ {
+ this.logger = logger;
+ this.packageManagementEvents = packageManagementEvents;
+ }
+
+ public IUpdatePackagesAction CreateAction(
+ PackageManagementSelectedProjects selectedProjects,
+ IEnumerable<IPackageFromRepository> packages)
+ {
+ this.selectedProjects = selectedProjects;
+ this.packages = packages;
+
+ singleProjectSelected = selectedProjects.HasSingleProjectSelected();
+
+ CreateProjectForDetermingPackageOperations();
+ IUpdatePackagesAction action = CreateActionInternal();
+ action.AddPackages(packages);
+ action.Logger = logger;
+
+ IEnumerable<PackageOperation> operations = GetPackageOperations(action);
+ action.AddOperations(operations);
+
+ return action;
+ }
+
+ IEnumerable<PackageOperation> GetPackageOperations(IUpdatePackagesAction action)
+ {
+ return project.GetUpdatePackagesOperations(packages, action);
+ }
+
+ IUpdatePackagesAction CreateActionInternal()
+ {
+ if (singleProjectSelected) {
+ return project.CreateUpdatePackagesAction();
+ } else {
+ return new UpdateSolutionPackagesAction(selectedProjects.Solution, packageManagementEvents);
+ }
+ }
+
+ void CreateProjectForDetermingPackageOperations()
+ {
+ IPackageRepository repository = packages.First().Repository;
+ if (singleProjectSelected) {
+ project = selectedProjects.GetSingleProjectSelected(repository);
+ } else {
+ project = selectedProjects.Solution.GetProjects(repository).First();
+ }
+ project.Logger = logger;
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateSolutionPackagesAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateSolutionPackagesAction.cs
new file mode 100644
index 0000000000..229156a1ad
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdateSolutionPackagesAction.cs
@@ -0,0 +1,149 @@
+//
+// UpdateSolutionPackagesAction.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class UpdateSolutionPackagesAction : IUpdatePackagesAction
+ {
+ List<IPackageFromRepository> packages = new List<IPackageFromRepository>();
+ List<PackageOperation> operations = new List<PackageOperation>();
+ List<IPackageManagementProject> projects;
+ IPackageManagementEvents packageManagementEvents;
+
+ public UpdateSolutionPackagesAction(
+ IPackageManagementSolution solution,
+ IPackageManagementEvents packageManagementEvents)
+ {
+ this.Solution = solution;
+ this.UpdateDependencies = true;
+ this.packageManagementEvents = packageManagementEvents;
+ }
+
+ public IPackageManagementSolution Solution { get; private set; }
+ //public IPackageScriptRunner PackageScriptRunner { get; set; }
+ public bool UpdateDependencies { get; set; }
+ public bool AllowPrereleaseVersions { get; set; }
+ public ILogger Logger { get; set; }
+
+ public IEnumerable<PackageOperation> Operations {
+ get { return operations; }
+ }
+
+ public IEnumerable<IPackageFromRepository> Packages {
+ get { return packages; }
+ }
+
+ public bool HasPackageScriptsToRun()
+ {
+ var files = new PackageFilesForOperations(Operations);
+ return files.HasAnyPackageScripts();
+ }
+
+ public void AddOperations(IEnumerable<PackageOperation> operations)
+ {
+ this.operations.AddRange(operations);
+ }
+
+ public void AddPackages(IEnumerable<IPackageFromRepository> packages)
+ {
+ this.packages.AddRange(packages);
+ }
+
+ public void Execute()
+ {
+ //if (PackageScriptRunner != null) {
+ // ExecuteWithScriptRunner();
+ //} else {
+ ExecuteCore();
+ //}
+ }
+
+// void ExecuteWithScriptRunner()
+// {
+// using (RunAllProjectPackageScriptsAction runScriptsAction = CreateRunPackageScriptsAction()) {
+// ExecuteCore();
+// }
+// }
+//
+// RunAllProjectPackageScriptsAction CreateRunPackageScriptsAction()
+// {
+// return CreateRunPackageScriptsAction(PackageScriptRunner, GetProjects());
+// }
+
+ void ExecuteCore()
+ {
+ RunPackageOperations();
+ UpdatePackageReferences();
+ packageManagementEvents.OnParentPackagesUpdated(Packages);
+ }
+
+ void RunPackageOperations()
+ {
+ IPackageManagementProject project = GetProjects().First();
+ project.RunPackageOperations(operations);
+ }
+
+ IEnumerable<IPackageManagementProject> GetProjects()
+ {
+ if (projects == null) {
+ IPackageFromRepository package = packages.First();
+ projects = Solution
+ .GetProjects(package.Repository)
+ .Select(project => {
+ project.Logger = Logger;
+ return project;
+ })
+ .ToList();
+ }
+ return projects;
+ }
+
+ void UpdatePackageReferences()
+ {
+ foreach (IPackageManagementProject project in GetProjects()) {
+ foreach (IPackageFromRepository package in packages) {
+ if (project.HasOlderPackageInstalled(package)) {
+ project.UpdatePackageReference(package, this);
+ }
+ }
+ }
+ }
+
+// protected virtual RunAllProjectPackageScriptsAction CreateRunPackageScriptsAction(
+// IPackageScriptRunner scriptRunner,
+// IEnumerable<IPackageManagementProject> projects)
+// {
+// return new RunAllProjectPackageScriptsAction(scriptRunner, projects);
+// }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModel.cs
new file mode 100644
index 0000000000..4b9985eed9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModel.cs
@@ -0,0 +1,58 @@
+//
+// UpdatedPackageViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class UpdatedPackageViewModel : PackageViewModel
+ {
+ public UpdatedPackageViewModel(
+ IPackageViewModelParent parent,
+ IPackageFromRepository package,
+ SelectedProjectsForUpdatedPackages selectedProjects,
+ IPackageManagementEvents packageManagementEvents,
+ IPackageActionRunner actionRunner,
+ ILogger logger)
+ : base(parent, package, selectedProjects, packageManagementEvents, actionRunner, logger)
+ {
+ }
+
+ protected override ProcessPackageOperationsAction CreateInstallPackageAction(
+ IPackageManagementProject project)
+ {
+ return project.CreateUpdatePackageAction();
+ }
+
+ protected override IDisposable StartInstallOperation(IPackageFromRepository package)
+ {
+ return package.StartUpdateOperation();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModelFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModelFactory.cs
new file mode 100644
index 0000000000..cd6ca00324
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModelFactory.cs
@@ -0,0 +1,55 @@
+//
+// UpdatePackageViewModelFactory.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class UpdatedPackageViewModelFactory : PackageViewModelFactory
+ {
+ SelectedProjectsForUpdatedPackages selectedProjectsForUpdatedPackages;
+
+ public UpdatedPackageViewModelFactory(IPackageViewModelFactory packageViewModelFactory)
+ : base(packageViewModelFactory)
+ {
+ selectedProjectsForUpdatedPackages = new SelectedProjectsForUpdatedPackages(Solution);
+ }
+
+ public override PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package)
+ {
+ return new UpdatedPackageViewModel(
+ parent,
+ package,
+ selectedProjectsForUpdatedPackages,
+ PackageManagementEvents,
+ PackageActionRunner,
+ Logger);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackages.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackages.cs
new file mode 100644
index 0000000000..75b631e786
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackages.cs
@@ -0,0 +1,100 @@
+//
+// UpdatedPackages.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class UpdatedPackages
+ {
+ IPackageRepository sourceRepository;
+ IQueryable<IPackage> installedPackages;
+
+ public UpdatedPackages(
+ IPackageManagementProject project,
+ IPackageRepository aggregateRepository)
+ : this(
+ project.GetPackages(),
+ aggregateRepository)
+ {
+ }
+
+ public UpdatedPackages(
+ IQueryable<IPackage> installedPackages,
+ IPackageRepository aggregrateRepository)
+ {
+ this.installedPackages = installedPackages;
+ this.sourceRepository = aggregrateRepository;
+ }
+
+ public string SearchTerms { get; set; }
+
+ public IEnumerable<IPackage> GetUpdatedPackages(bool includePrerelease = false)
+ {
+ IQueryable<IPackage> localPackages = installedPackages;
+ localPackages = FilterPackages(localPackages);
+ IEnumerable<IPackage> distinctLocalPackages = DistinctPackages(localPackages);
+ return GetUpdatedPackages(sourceRepository, distinctLocalPackages, includePrerelease);
+ }
+
+ IQueryable<IPackage> GetInstalledPackages()
+ {
+ return installedPackages;
+ }
+
+ IQueryable<IPackage> FilterPackages(IQueryable<IPackage> localPackages)
+ {
+ return localPackages.Find(SearchTerms);
+ }
+
+ /// <summary>
+ /// If we have jQuery 1.6 and 1.7 then return just jquery 1.6
+ /// </summary>
+ IEnumerable<IPackage> DistinctPackages(IQueryable<IPackage> localPackages)
+ {
+ List<IPackage> packages = localPackages.ToList();
+ if (packages.Any()) {
+ packages.Sort(PackageComparer.Version);
+ return packages.Distinct(PackageEqualityComparer.Id).ToList();
+ }
+ return packages;
+ }
+
+ IEnumerable<IPackage> GetUpdatedPackages(
+ IPackageRepository sourceRepository,
+ IEnumerable<IPackage> localPackages,
+ bool includePrelease)
+ {
+ return sourceRepository.GetUpdates(localPackages, includePrelease, false);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesViewModel.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesViewModel.cs
new file mode 100644
index 0000000000..e268abcbf4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackagesViewModel.cs
@@ -0,0 +1,130 @@
+//
+// UpdatedPackagesViewModel.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class UpdatedPackagesViewModel : PackagesViewModel
+ {
+ PackageManagementSelectedProjects selectedProjects;
+ UpdatedPackages updatedPackages;
+ string errorMessage = String.Empty;
+ ILogger logger;
+ IPackageManagementEvents packageManagementEvents;
+
+ public UpdatedPackagesViewModel(
+ IPackageManagementSolution solution,
+ IRegisteredPackageRepositories registeredPackageRepositories,
+ UpdatedPackageViewModelFactory packageViewModelFactory,
+ ITaskFactory taskFactory)
+ : base(
+ registeredPackageRepositories,
+ packageViewModelFactory,
+ taskFactory)
+ {
+ this.selectedProjects = new PackageManagementSelectedProjects(solution);
+ this.logger = packageViewModelFactory.Logger;
+ this.packageManagementEvents = packageViewModelFactory.PackageManagementEvents;
+
+ packageManagementEvents.ParentPackagesUpdated += PackagesUpdated;
+
+ ShowPackageSources = true;
+ ShowUpdateAllPackages = true;
+ ShowPrerelease = true;
+ }
+
+ void PackagesUpdated(object sender, EventArgs e)
+ {
+ ReadPackages();
+ }
+
+ protected override void OnDispose()
+ {
+ packageManagementEvents.ParentPackagesUpdated -= PackagesUpdated;
+ }
+
+ protected override void UpdateRepositoryBeforeReadPackagesTaskStarts()
+ {
+ try {
+ IPackageRepository repository = RegisteredPackageRepositories.ActiveRepository;
+ IQueryable<IPackage> installedPackages = GetInstalledPackages(repository);
+ updatedPackages = new UpdatedPackages(installedPackages, repository);
+ } catch (Exception ex) {
+ errorMessage = ex.Message;
+ }
+ }
+
+ IQueryable<IPackage> GetInstalledPackages(IPackageRepository aggregateRepository)
+ {
+ return selectedProjects.GetInstalledPackages(aggregateRepository);
+ }
+
+ protected override IQueryable<IPackage> GetAllPackages()
+ {
+ if (updatedPackages == null) {
+ ThrowSavedException();
+ }
+ return GetUpdatedPackages();
+ }
+
+ void ThrowSavedException()
+ {
+ throw new ApplicationException(errorMessage);
+ }
+
+ IQueryable<IPackage> GetUpdatedPackages()
+ {
+ return updatedPackages.GetUpdatedPackages(IncludePrerelease).AsQueryable();
+ }
+
+ protected override void TryUpdatingAllPackages()
+ {
+ List<IPackageFromRepository> packages = GetPackagesFromViewModels().ToList();
+ using (IDisposable operation = StartUpdateOperation(packages.First())) {
+ var factory = new UpdatePackagesActionFactory(logger, packageManagementEvents);
+ IUpdatePackagesAction action = factory.CreateAction(selectedProjects, packages);
+ ActionRunner.Run(action);
+ }
+ }
+
+ IDisposable StartUpdateOperation(IPackageFromRepository package)
+ {
+ return package.Repository.StartUpdateOperation();
+ }
+
+ IEnumerable<IPackageFromRepository> GetPackagesFromViewModels()
+ {
+ return PackageViewModels.Select(viewModel => viewModel.GetPackage() as IPackageFromRepository);
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UserAgentGeneratorForRepositoryRequests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UserAgentGeneratorForRepositoryRequests.cs
new file mode 100644
index 0000000000..74a93b5ed9
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UserAgentGeneratorForRepositoryRequests.cs
@@ -0,0 +1,60 @@
+//
+// UserAgentGeneratorForRepositoryRequests.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public class UserAgentGeneratorForRepositoryRequests
+ {
+ MonoDevelopHttpUserAgent userAgent = new MonoDevelopHttpUserAgent();
+
+ public UserAgentGeneratorForRepositoryRequests(IPackageRepositoryFactoryEvents repositoryFactoryEvents)
+ {
+ repositoryFactoryEvents.RepositoryCreated += RepositoryCreated;
+ }
+
+ void RepositoryCreated(object sender, PackageRepositoryFactoryEventArgs e)
+ {
+ RegisterHttpClient(e.Repository as IHttpClientEvents);
+ }
+
+ void RegisterHttpClient(IHttpClientEvents clientEvents)
+ {
+ if (clientEvents != null) {
+ clientEvents.SendingRequest += SendingRequest;
+ }
+ }
+
+ void SendingRequest(object sender, WebRequestEventArgs e)
+ {
+ HttpUtility.SetUserAgent(e.Request, userAgent.ToString());
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ViewModelBase.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ViewModelBase.cs
new file mode 100644
index 0000000000..c2f2798e9d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ViewModelBase.cs
@@ -0,0 +1,66 @@
+//
+// ViewModelBase.cs
+//
+// Author:
+// Matt Ward <ward.matt@gmail.com>
+//
+// Copyright (C) 2013 Matthew Ward
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.ComponentModel;
+using System.Linq.Expressions;
+
+namespace ICSharpCode.PackageManagement
+{
+ public abstract class ViewModelBase<TModel> : INotifyPropertyChanged
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ public string PropertyChangedFor<TProperty>(Expression<Func<TModel, TProperty>> expression)
+ {
+ MemberExpression memberExpression = expression.Body as MemberExpression;
+ return PropertyChangedFor(memberExpression);
+ }
+
+ string PropertyChangedFor(MemberExpression memberExpression)
+ {
+ if (memberExpression != null) {
+ return memberExpression.Member.Name;
+ }
+ return String.Empty;
+ }
+
+ protected void OnPropertyChanged<TProperty>(Expression<Func<TModel, TProperty>> expression)
+ {
+ string propertyName = PropertyChangedFor(expression);
+ OnPropertyChanged(propertyName);
+ }
+
+ protected void OnPropertyChanged(string propertyName)
+ {
+ if (PropertyChanged != null) {
+ PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.HyperlinkWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.HyperlinkWidget.cs
new file mode 100644
index 0000000000..32cdd17bb4
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.HyperlinkWidget.cs
@@ -0,0 +1,19 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.PackageManagement
+{
+ public partial class HyperlinkWidget
+ {
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.PackageManagement.HyperlinkWidget
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "MonoDevelop.PackageManagement.HyperlinkWidget";
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Hide ();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs
new file mode 100644
index 0000000000..cc06e01c56
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs
@@ -0,0 +1,141 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.PackageManagement
+{
+ public partial class LicenseAcceptanceDialog
+ {
+ private global::Gtk.HBox subTitleHBoxForSinglePackage;
+ private global::Gtk.Label subTitleLabelForSinglePackage;
+ private global::Gtk.HBox subTitleHBoxForMultiplePackages;
+ private global::Gtk.Label subTitleLabelForMultiplePackages;
+ private global::Gtk.ScrolledWindow GtkScrolledWindow;
+ private global::Gtk.VBox packagesVBox;
+ private global::Gtk.HBox bottomMessageHBox;
+ private global::Gtk.Label mainMessageLabel;
+ private global::Gtk.Button buttonCancel;
+ private global::Gtk.Button buttonOk;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.PackageManagement.LicenseAcceptanceDialog
+ this.Name = "MonoDevelop.PackageManagement.LicenseAcceptanceDialog";
+ this.Title = global::Mono.Unix.Catalog.GetString ("License Agreements");
+ this.WindowPosition = ((global::Gtk.WindowPosition)(1));
+ this.Modal = true;
+ // Internal child MonoDevelop.PackageManagement.LicenseAcceptanceDialog.VBox
+ global::Gtk.VBox w1 = this.VBox;
+ w1.Name = "mainVBox";
+ w1.BorderWidth = ((uint)(2));
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.subTitleHBoxForSinglePackage = new global::Gtk.HBox ();
+ this.subTitleHBoxForSinglePackage.Name = "subTitleHBoxForSinglePackage";
+ this.subTitleHBoxForSinglePackage.Spacing = 6;
+ // Container child subTitleHBoxForSinglePackage.Gtk.Box+BoxChild
+ this.subTitleLabelForSinglePackage = new global::Gtk.Label ();
+ this.subTitleLabelForSinglePackage.Name = "subTitleLabelForSinglePackage";
+ this.subTitleLabelForSinglePackage.LabelProp = global::Mono.Unix.Catalog.GetString ("The following package requires a click-to-accept license:");
+ this.subTitleHBoxForSinglePackage.Add (this.subTitleLabelForSinglePackage);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.subTitleHBoxForSinglePackage [this.subTitleLabelForSinglePackage]));
+ w2.Position = 0;
+ w2.Expand = false;
+ w2.Fill = false;
+ w1.Add (this.subTitleHBoxForSinglePackage);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1 [this.subTitleHBoxForSinglePackage]));
+ w3.Position = 0;
+ w3.Expand = false;
+ w3.Fill = false;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.subTitleHBoxForMultiplePackages = new global::Gtk.HBox ();
+ this.subTitleHBoxForMultiplePackages.Name = "subTitleHBoxForMultiplePackages";
+ this.subTitleHBoxForMultiplePackages.Spacing = 6;
+ // Container child subTitleHBoxForMultiplePackages.Gtk.Box+BoxChild
+ this.subTitleLabelForMultiplePackages = new global::Gtk.Label ();
+ this.subTitleLabelForMultiplePackages.Name = "subTitleLabelForMultiplePackages";
+ this.subTitleLabelForMultiplePackages.LabelProp = global::Mono.Unix.Catalog.GetString ("The following packages require a click-to-accept license:");
+ this.subTitleHBoxForMultiplePackages.Add (this.subTitleLabelForMultiplePackages);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.subTitleHBoxForMultiplePackages [this.subTitleLabelForMultiplePackages]));
+ w4.Position = 0;
+ w4.Expand = false;
+ w4.Fill = false;
+ w1.Add (this.subTitleHBoxForMultiplePackages);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.subTitleHBoxForMultiplePackages]));
+ w5.Position = 1;
+ w5.Expand = false;
+ w5.Fill = false;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow.Name = "GtkScrolledWindow";
+ this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
+ global::Gtk.Viewport w6 = new global::Gtk.Viewport ();
+ w6.ShadowType = ((global::Gtk.ShadowType)(0));
+ // Container child GtkViewport.Gtk.Container+ContainerChild
+ this.packagesVBox = new global::Gtk.VBox ();
+ this.packagesVBox.Name = "packagesVBox";
+ this.packagesVBox.Spacing = 6;
+ w6.Add (this.packagesVBox);
+ this.GtkScrolledWindow.Add (w6);
+ w1.Add (this.GtkScrolledWindow);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.GtkScrolledWindow]));
+ w9.Position = 2;
+ w9.Padding = ((uint)(3));
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.bottomMessageHBox = new global::Gtk.HBox ();
+ this.bottomMessageHBox.Name = "bottomMessageHBox";
+ this.bottomMessageHBox.Spacing = 6;
+ // Container child bottomMessageHBox.Gtk.Box+BoxChild
+ this.mainMessageLabel = new global::Gtk.Label ();
+ this.mainMessageLabel.Name = "mainMessageLabel";
+ this.mainMessageLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("By clicking \"OK\" you agree to the license terms for the packages listed above.\nIf" +
+ " you do not agree to the license terms click \"Cancel\".");
+ this.bottomMessageHBox.Add (this.mainMessageLabel);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.bottomMessageHBox [this.mainMessageLabel]));
+ w10.Position = 0;
+ w10.Expand = false;
+ w10.Fill = false;
+ w1.Add (this.bottomMessageHBox);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(w1 [this.bottomMessageHBox]));
+ w11.Position = 3;
+ w11.Expand = false;
+ w11.Fill = false;
+ // Internal child MonoDevelop.PackageManagement.LicenseAcceptanceDialog.ActionArea
+ global::Gtk.HButtonBox w12 = this.ActionArea;
+ w12.Name = "mainButtonArea";
+ w12.Spacing = 10;
+ w12.BorderWidth = ((uint)(5));
+ w12.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ // Container child mainButtonArea.Gtk.ButtonBox+ButtonBoxChild
+ this.buttonCancel = new global::Gtk.Button ();
+ this.buttonCancel.CanDefault = true;
+ this.buttonCancel.CanFocus = true;
+ this.buttonCancel.Name = "buttonCancel";
+ this.buttonCancel.UseStock = true;
+ this.buttonCancel.UseUnderline = true;
+ this.buttonCancel.Label = "gtk-cancel";
+ this.AddActionWidget (this.buttonCancel, -6);
+ global::Gtk.ButtonBox.ButtonBoxChild w13 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonCancel]));
+ w13.Expand = false;
+ w13.Fill = false;
+ // Container child mainButtonArea.Gtk.ButtonBox+ButtonBoxChild
+ this.buttonOk = new global::Gtk.Button ();
+ this.buttonOk.CanDefault = true;
+ this.buttonOk.CanFocus = true;
+ this.buttonOk.Name = "buttonOk";
+ this.buttonOk.UseStock = true;
+ this.buttonOk.UseUnderline = true;
+ this.buttonOk.Label = "gtk-ok";
+ this.AddActionWidget (this.buttonOk, -5);
+ global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w12 [this.buttonOk]));
+ w14.Position = 1;
+ w14.Expand = false;
+ w14.Fill = false;
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.DefaultWidth = 447;
+ this.DefaultHeight = 300;
+ this.Show ();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.ManagePackagesDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.ManagePackagesDialog.cs
new file mode 100644
index 0000000000..9e8341af22
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.ManagePackagesDialog.cs
@@ -0,0 +1,143 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.PackageManagement
+{
+ public partial class ManagePackagesDialog
+ {
+ private global::Gtk.Notebook notebook;
+ private global::MonoDevelop.PackageManagement.PackagesWidget availablePackagesWidget;
+ private global::Gtk.Label availablePackagesLabel;
+ private global::MonoDevelop.PackageManagement.PackagesWidget installedPackagesWidget;
+ private global::Gtk.Label installedPackagesLabel;
+ private global::MonoDevelop.PackageManagement.PackagesWidget UpdatedPackagesWidget;
+ private global::Gtk.Label updatedPackagesLabel;
+ private global::MonoDevelop.PackageManagement.PackagesWidget recentPackagesWidget;
+ private global::Gtk.Label recentPackagesLabel;
+ private global::Gtk.Expander messagesExpander;
+ private global::Gtk.ScrolledWindow GtkScrolledWindow8;
+ private global::Gtk.TextView messagesTextView;
+ private global::Gtk.Label messagesExpanderLabel;
+ private global::Gtk.Button buttonClose;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.PackageManagement.ManagePackagesDialog
+ this.Name = "MonoDevelop.PackageManagement.ManagePackagesDialog";
+ this.Title = global::Mono.Unix.Catalog.GetString ("Manage Packages");
+ this.WindowPosition = ((global::Gtk.WindowPosition)(1));
+ this.DefaultWidth = 640;
+ this.DefaultHeight = 480;
+ // Internal child MonoDevelop.PackageManagement.ManagePackagesDialog.VBox
+ global::Gtk.VBox w1 = this.VBox;
+ w1.Name = "mainVBox";
+ w1.BorderWidth = ((uint)(2));
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.notebook = new global::Gtk.Notebook ();
+ this.notebook.CanFocus = true;
+ this.notebook.Name = "notebook";
+ this.notebook.CurrentPage = 0;
+ // Container child notebook.Gtk.Notebook+NotebookChild
+ this.availablePackagesWidget = new global::MonoDevelop.PackageManagement.PackagesWidget ();
+ this.availablePackagesWidget.Events = ((global::Gdk.EventMask)(256));
+ this.availablePackagesWidget.Name = "availablePackagesWidget";
+ this.notebook.Add (this.availablePackagesWidget);
+ // Notebook tab
+ this.availablePackagesLabel = new global::Gtk.Label ();
+ this.availablePackagesLabel.Name = "availablePackagesLabel";
+ this.availablePackagesLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Available");
+ this.notebook.SetTabLabel (this.availablePackagesWidget, this.availablePackagesLabel);
+ this.availablePackagesLabel.ShowAll ();
+ // Container child notebook.Gtk.Notebook+NotebookChild
+ this.installedPackagesWidget = new global::MonoDevelop.PackageManagement.PackagesWidget ();
+ this.installedPackagesWidget.Events = ((global::Gdk.EventMask)(256));
+ this.installedPackagesWidget.Name = "installedPackagesWidget";
+ this.notebook.Add (this.installedPackagesWidget);
+ global::Gtk.Notebook.NotebookChild w3 = ((global::Gtk.Notebook.NotebookChild)(this.notebook [this.installedPackagesWidget]));
+ w3.Position = 1;
+ // Notebook tab
+ this.installedPackagesLabel = new global::Gtk.Label ();
+ this.installedPackagesLabel.Name = "installedPackagesLabel";
+ this.installedPackagesLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Installed");
+ this.notebook.SetTabLabel (this.installedPackagesWidget, this.installedPackagesLabel);
+ this.installedPackagesLabel.ShowAll ();
+ // Container child notebook.Gtk.Notebook+NotebookChild
+ this.UpdatedPackagesWidget = new global::MonoDevelop.PackageManagement.PackagesWidget ();
+ this.UpdatedPackagesWidget.Events = ((global::Gdk.EventMask)(256));
+ this.UpdatedPackagesWidget.Name = "UpdatedPackagesWidget";
+ this.notebook.Add (this.UpdatedPackagesWidget);
+ global::Gtk.Notebook.NotebookChild w4 = ((global::Gtk.Notebook.NotebookChild)(this.notebook [this.UpdatedPackagesWidget]));
+ w4.Position = 2;
+ // Notebook tab
+ this.updatedPackagesLabel = new global::Gtk.Label ();
+ this.updatedPackagesLabel.Name = "updatedPackagesLabel";
+ this.updatedPackagesLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Updated");
+ this.notebook.SetTabLabel (this.UpdatedPackagesWidget, this.updatedPackagesLabel);
+ this.updatedPackagesLabel.ShowAll ();
+ // Container child notebook.Gtk.Notebook+NotebookChild
+ this.recentPackagesWidget = new global::MonoDevelop.PackageManagement.PackagesWidget ();
+ this.recentPackagesWidget.Events = ((global::Gdk.EventMask)(256));
+ this.recentPackagesWidget.Name = "recentPackagesWidget";
+ this.notebook.Add (this.recentPackagesWidget);
+ global::Gtk.Notebook.NotebookChild w5 = ((global::Gtk.Notebook.NotebookChild)(this.notebook [this.recentPackagesWidget]));
+ w5.Position = 3;
+ // Notebook tab
+ this.recentPackagesLabel = new global::Gtk.Label ();
+ this.recentPackagesLabel.Name = "recentPackagesLabel";
+ this.recentPackagesLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Recent");
+ this.notebook.SetTabLabel (this.recentPackagesWidget, this.recentPackagesLabel);
+ this.recentPackagesLabel.ShowAll ();
+ w1.Add (this.notebook);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook]));
+ w6.Position = 0;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.messagesExpander = new global::Gtk.Expander (null);
+ this.messagesExpander.CanFocus = true;
+ this.messagesExpander.Name = "messagesExpander";
+ // Container child messagesExpander.Gtk.Container+ContainerChild
+ this.GtkScrolledWindow8 = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow8.Name = "GtkScrolledWindow8";
+ this.GtkScrolledWindow8.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow8.Gtk.Container+ContainerChild
+ this.messagesTextView = new global::Gtk.TextView ();
+ this.messagesTextView.CanFocus = true;
+ this.messagesTextView.Name = "messagesTextView";
+ this.messagesTextView.Editable = false;
+ this.messagesTextView.CursorVisible = false;
+ this.GtkScrolledWindow8.Add (this.messagesTextView);
+ this.messagesExpander.Add (this.GtkScrolledWindow8);
+ this.messagesExpanderLabel = new global::Gtk.Label ();
+ this.messagesExpanderLabel.Name = "messagesExpanderLabel";
+ this.messagesExpanderLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Messages");
+ this.messagesExpanderLabel.UseUnderline = true;
+ this.messagesExpander.LabelWidget = this.messagesExpanderLabel;
+ w1.Add (this.messagesExpander);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.messagesExpander]));
+ w9.Position = 1;
+ w9.Expand = false;
+ // Internal child MonoDevelop.PackageManagement.ManagePackagesDialog.ActionArea
+ global::Gtk.HButtonBox w10 = this.ActionArea;
+ w10.Name = "buttonArea";
+ w10.Spacing = 10;
+ w10.BorderWidth = ((uint)(5));
+ w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ // Container child buttonArea.Gtk.ButtonBox+ButtonBoxChild
+ this.buttonClose = new global::Gtk.Button ();
+ this.buttonClose.CanDefault = true;
+ this.buttonClose.CanFocus = true;
+ this.buttonClose.Name = "buttonClose";
+ this.buttonClose.UseStock = true;
+ this.buttonClose.UseUnderline = true;
+ this.buttonClose.Label = "gtk-close";
+ this.AddActionWidget (this.buttonClose, -7);
+ global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonClose]));
+ w11.Expand = false;
+ w11.Fill = false;
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Show ();
+ this.messagesExpander.Activated += new global::System.EventHandler (this.MessagesExpanderActivated);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageLicenseWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageLicenseWidget.cs
new file mode 100644
index 0000000000..54bdbf5a6d
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageLicenseWidget.cs
@@ -0,0 +1,90 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.PackageManagement
+{
+ public partial class PackageLicenseWidget
+ {
+ private global::Gtk.HBox mainHBox;
+ private global::Gtk.VBox packageIdVBox;
+ private global::Gtk.HBox packageIdHBox;
+ private global::Gtk.Label packageIdLabel;
+ private global::MonoDevelop.PackageManagement.HyperlinkWidget licenseHyperlinkWidget;
+ private global::Gtk.Label fillerLabel;
+ private global::Gtk.ScrolledWindow GtkScrolledWindow;
+ private global::Gtk.TextView packageSummaryTextView;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.PackageManagement.PackageLicenseWidget
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "MonoDevelop.PackageManagement.PackageLicenseWidget";
+ // Container child MonoDevelop.PackageManagement.PackageLicenseWidget.Gtk.Container+ContainerChild
+ this.mainHBox = new global::Gtk.HBox ();
+ this.mainHBox.Name = "mainHBox";
+ this.mainHBox.Spacing = 6;
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.packageIdVBox = new global::Gtk.VBox ();
+ this.packageIdVBox.Name = "packageIdVBox";
+ this.packageIdVBox.Spacing = 6;
+ // Container child packageIdVBox.Gtk.Box+BoxChild
+ this.packageIdHBox = new global::Gtk.HBox ();
+ this.packageIdHBox.Name = "packageIdHBox";
+ this.packageIdHBox.Spacing = 6;
+ // Container child packageIdHBox.Gtk.Box+BoxChild
+ this.packageIdLabel = new global::Gtk.Label ();
+ this.packageIdLabel.Name = "packageIdLabel";
+ this.packageIdLabel.UseMarkup = true;
+ this.packageIdHBox.Add (this.packageIdLabel);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.packageIdHBox [this.packageIdLabel]));
+ w1.Position = 0;
+ w1.Expand = false;
+ w1.Fill = false;
+ this.packageIdVBox.Add (this.packageIdHBox);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.packageIdVBox [this.packageIdHBox]));
+ w2.Position = 0;
+ w2.Expand = false;
+ w2.Fill = false;
+ // Container child packageIdVBox.Gtk.Box+BoxChild
+ this.licenseHyperlinkWidget = new global::MonoDevelop.PackageManagement.HyperlinkWidget ();
+ this.licenseHyperlinkWidget.Events = ((global::Gdk.EventMask)(256));
+ this.licenseHyperlinkWidget.Name = "licenseHyperlinkWidget";
+ this.licenseHyperlinkWidget.Label = "View License Terms";
+ this.packageIdVBox.Add (this.licenseHyperlinkWidget);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.packageIdVBox [this.licenseHyperlinkWidget]));
+ w3.Position = 1;
+ w3.Expand = false;
+ // Container child packageIdVBox.Gtk.Box+BoxChild
+ this.fillerLabel = new global::Gtk.Label ();
+ this.fillerLabel.Name = "fillerLabel";
+ this.packageIdVBox.Add (this.fillerLabel);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.packageIdVBox [this.fillerLabel]));
+ w4.Position = 2;
+ this.mainHBox.Add (this.packageIdVBox);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.packageIdVBox]));
+ w5.Position = 0;
+ w5.Expand = false;
+ w5.Fill = false;
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow.Name = "GtkScrolledWindow";
+ this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
+ this.packageSummaryTextView = new global::Gtk.TextView ();
+ this.packageSummaryTextView.CanFocus = true;
+ this.packageSummaryTextView.Name = "packageSummaryTextView";
+ this.packageSummaryTextView.Editable = false;
+ this.packageSummaryTextView.CursorVisible = false;
+ this.packageSummaryTextView.WrapMode = ((global::Gtk.WrapMode)(2));
+ this.GtkScrolledWindow.Add (this.packageSummaryTextView);
+ this.mainHBox.Add (this.GtkScrolledWindow);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.GtkScrolledWindow]));
+ w7.Position = 1;
+ this.Add (this.mainHBox);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Hide ();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs
new file mode 100644
index 0000000000..d07271f536
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs
@@ -0,0 +1,211 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.PackageManagement
+{
+ public partial class PackageManagementOptionsWidget
+ {
+ private global::Gtk.VBox mainVBox;
+ private global::Gtk.HBox recentPackagesLabelHBox;
+ private global::Gtk.Label recentPackagesFrameLabel;
+ private global::Gtk.Label recentPackagesPaddingLabel;
+ private global::Gtk.HButtonBox recentPackagesButtonBox;
+ private global::Gtk.Button clearRecentPackagesButton;
+ private global::Gtk.HBox packagesCacheLabelHBox;
+ private global::Gtk.Label packagesCacheLabel;
+ private global::Gtk.Label packagesCachePaddingLabel;
+ private global::Gtk.HBox packagesCacheHBox;
+ private global::Gtk.HButtonBox packagesCacheButtonBox;
+ private global::Gtk.Button clearPackagesCacheButton;
+ private global::Gtk.HBox browseButtonHBox;
+ private global::Gtk.Button browseButton;
+ private global::Gtk.HBox restorePackagesLabelHBox;
+ private global::Gtk.Label restorePackagesLabel;
+ private global::Gtk.Label restorePackagesPaddingLabel;
+ private global::Gtk.CheckButton restorePackagesCheckBox;
+ private global::Gtk.Label bottomLabel;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.PackageManagement.PackageManagementOptionsWidget
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "MonoDevelop.PackageManagement.PackageManagementOptionsWidget";
+ // Container child MonoDevelop.PackageManagement.PackageManagementOptionsWidget.Gtk.Container+ContainerChild
+ this.mainVBox = new global::Gtk.VBox ();
+ this.mainVBox.Name = "mainVBox";
+ this.mainVBox.Spacing = 6;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.recentPackagesLabelHBox = new global::Gtk.HBox ();
+ this.recentPackagesLabelHBox.Name = "recentPackagesLabelHBox";
+ this.recentPackagesLabelHBox.Spacing = 6;
+ // Container child recentPackagesLabelHBox.Gtk.Box+BoxChild
+ this.recentPackagesFrameLabel = new global::Gtk.Label ();
+ this.recentPackagesFrameLabel.Name = "recentPackagesFrameLabel";
+ this.recentPackagesFrameLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Recent Packages</b>");
+ this.recentPackagesFrameLabel.UseMarkup = true;
+ this.recentPackagesLabelHBox.Add (this.recentPackagesFrameLabel);
+ global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.recentPackagesLabelHBox [this.recentPackagesFrameLabel]));
+ w1.Position = 0;
+ w1.Expand = false;
+ w1.Fill = false;
+ // Container child recentPackagesLabelHBox.Gtk.Box+BoxChild
+ this.recentPackagesPaddingLabel = new global::Gtk.Label ();
+ this.recentPackagesPaddingLabel.Name = "recentPackagesPaddingLabel";
+ this.recentPackagesLabelHBox.Add (this.recentPackagesPaddingLabel);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.recentPackagesLabelHBox [this.recentPackagesPaddingLabel]));
+ w2.Position = 1;
+ this.mainVBox.Add (this.recentPackagesLabelHBox);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.mainVBox [this.recentPackagesLabelHBox]));
+ w3.Position = 0;
+ w3.Expand = false;
+ w3.Fill = false;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.recentPackagesButtonBox = new global::Gtk.HButtonBox ();
+ this.recentPackagesButtonBox.Name = "recentPackagesButtonBox";
+ this.recentPackagesButtonBox.BorderWidth = ((uint)(8));
+ this.recentPackagesButtonBox.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(3));
+ // Container child recentPackagesButtonBox.Gtk.ButtonBox+ButtonBoxChild
+ this.clearRecentPackagesButton = new global::Gtk.Button ();
+ this.clearRecentPackagesButton.CanFocus = true;
+ this.clearRecentPackagesButton.Name = "clearRecentPackagesButton";
+ this.clearRecentPackagesButton.UseUnderline = true;
+ this.clearRecentPackagesButton.Label = global::Mono.Unix.Catalog.GetString ("Clear _Recent Packages");
+ this.recentPackagesButtonBox.Add (this.clearRecentPackagesButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w4 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.recentPackagesButtonBox [this.clearRecentPackagesButton]));
+ w4.Expand = false;
+ w4.Fill = false;
+ this.mainVBox.Add (this.recentPackagesButtonBox);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.mainVBox [this.recentPackagesButtonBox]));
+ w5.Position = 1;
+ w5.Expand = false;
+ w5.Fill = false;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.packagesCacheLabelHBox = new global::Gtk.HBox ();
+ this.packagesCacheLabelHBox.Name = "packagesCacheLabelHBox";
+ this.packagesCacheLabelHBox.Spacing = 6;
+ // Container child packagesCacheLabelHBox.Gtk.Box+BoxChild
+ this.packagesCacheLabel = new global::Gtk.Label ();
+ this.packagesCacheLabel.Name = "packagesCacheLabel";
+ this.packagesCacheLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Packages Cache</b>");
+ this.packagesCacheLabel.UseMarkup = true;
+ this.packagesCacheLabelHBox.Add (this.packagesCacheLabel);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.packagesCacheLabelHBox [this.packagesCacheLabel]));
+ w6.Position = 0;
+ w6.Expand = false;
+ w6.Fill = false;
+ // Container child packagesCacheLabelHBox.Gtk.Box+BoxChild
+ this.packagesCachePaddingLabel = new global::Gtk.Label ();
+ this.packagesCachePaddingLabel.Name = "packagesCachePaddingLabel";
+ this.packagesCacheLabelHBox.Add (this.packagesCachePaddingLabel);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.packagesCacheLabelHBox [this.packagesCachePaddingLabel]));
+ w7.Position = 1;
+ this.mainVBox.Add (this.packagesCacheLabelHBox);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.mainVBox [this.packagesCacheLabelHBox]));
+ w8.Position = 2;
+ w8.Expand = false;
+ w8.Fill = false;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.packagesCacheHBox = new global::Gtk.HBox ();
+ this.packagesCacheHBox.Name = "packagesCacheHBox";
+ this.packagesCacheHBox.Spacing = 6;
+ // Container child packagesCacheHBox.Gtk.Box+BoxChild
+ this.packagesCacheButtonBox = new global::Gtk.HButtonBox ();
+ this.packagesCacheButtonBox.Name = "packagesCacheButtonBox";
+ this.packagesCacheButtonBox.BorderWidth = ((uint)(8));
+ this.packagesCacheButtonBox.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(3));
+ // Container child packagesCacheButtonBox.Gtk.ButtonBox+ButtonBoxChild
+ this.clearPackagesCacheButton = new global::Gtk.Button ();
+ this.clearPackagesCacheButton.CanFocus = true;
+ this.clearPackagesCacheButton.Name = "clearPackagesCacheButton";
+ this.clearPackagesCacheButton.UseUnderline = true;
+ this.clearPackagesCacheButton.Label = global::Mono.Unix.Catalog.GetString ("Clear Package _Cache");
+ this.packagesCacheButtonBox.Add (this.clearPackagesCacheButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.packagesCacheButtonBox [this.clearPackagesCacheButton]));
+ w9.Expand = false;
+ w9.Fill = false;
+ this.packagesCacheHBox.Add (this.packagesCacheButtonBox);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.packagesCacheHBox [this.packagesCacheButtonBox]));
+ w10.Position = 0;
+ w10.Expand = false;
+ // Container child packagesCacheHBox.Gtk.Box+BoxChild
+ this.browseButtonHBox = new global::Gtk.HBox ();
+ this.browseButtonHBox.Name = "browseButtonHBox";
+ this.browseButtonHBox.Spacing = 6;
+ // Container child browseButtonHBox.Gtk.Box+BoxChild
+ this.browseButton = new global::Gtk.Button ();
+ this.browseButton.CanFocus = true;
+ this.browseButton.Name = "browseButton";
+ this.browseButton.UseUnderline = true;
+ this.browseButton.BorderWidth = ((uint)(8));
+ this.browseButton.Label = global::Mono.Unix.Catalog.GetString ("_Browse...");
+ this.browseButtonHBox.Add (this.browseButton);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.browseButtonHBox [this.browseButton]));
+ w11.Position = 0;
+ w11.Expand = false;
+ w11.Fill = false;
+ this.packagesCacheHBox.Add (this.browseButtonHBox);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.packagesCacheHBox [this.browseButtonHBox]));
+ w12.Position = 1;
+ w12.Expand = false;
+ w12.Fill = false;
+ this.mainVBox.Add (this.packagesCacheHBox);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.mainVBox [this.packagesCacheHBox]));
+ w13.Position = 3;
+ w13.Expand = false;
+ w13.Fill = false;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.restorePackagesLabelHBox = new global::Gtk.HBox ();
+ this.restorePackagesLabelHBox.Name = "restorePackagesLabelHBox";
+ this.restorePackagesLabelHBox.Spacing = 6;
+ // Container child restorePackagesLabelHBox.Gtk.Box+BoxChild
+ this.restorePackagesLabel = new global::Gtk.Label ();
+ this.restorePackagesLabel.Name = "restorePackagesLabel";
+ this.restorePackagesLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Restore Packages</b>");
+ this.restorePackagesLabel.UseMarkup = true;
+ this.restorePackagesLabelHBox.Add (this.restorePackagesLabel);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.restorePackagesLabelHBox [this.restorePackagesLabel]));
+ w14.Position = 0;
+ w14.Expand = false;
+ w14.Fill = false;
+ // Container child restorePackagesLabelHBox.Gtk.Box+BoxChild
+ this.restorePackagesPaddingLabel = new global::Gtk.Label ();
+ this.restorePackagesPaddingLabel.Name = "restorePackagesPaddingLabel";
+ this.restorePackagesLabelHBox.Add (this.restorePackagesPaddingLabel);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.restorePackagesLabelHBox [this.restorePackagesPaddingLabel]));
+ w15.Position = 1;
+ this.mainVBox.Add (this.restorePackagesLabelHBox);
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.mainVBox [this.restorePackagesLabelHBox]));
+ w16.Position = 4;
+ w16.Expand = false;
+ w16.Fill = false;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.restorePackagesCheckBox = new global::Gtk.CheckButton ();
+ this.restorePackagesCheckBox.CanFocus = true;
+ this.restorePackagesCheckBox.Name = "restorePackagesCheckBox";
+ this.restorePackagesCheckBox.Label = global::Mono.Unix.Catalog.GetString ("_Enable package restore");
+ this.restorePackagesCheckBox.DrawIndicator = true;
+ this.restorePackagesCheckBox.UseUnderline = true;
+ this.restorePackagesCheckBox.BorderWidth = ((uint)(10));
+ this.mainVBox.Add (this.restorePackagesCheckBox);
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.mainVBox [this.restorePackagesCheckBox]));
+ w17.Position = 5;
+ w17.Expand = false;
+ w17.Fill = false;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.bottomLabel = new global::Gtk.Label ();
+ this.bottomLabel.Name = "bottomLabel";
+ this.mainVBox.Add (this.bottomLabel);
+ global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.mainVBox [this.bottomLabel]));
+ w18.Position = 6;
+ this.Add (this.mainVBox);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Hide ();
+ this.clearRecentPackagesButton.Clicked += new global::System.EventHandler (this.ClearRecentPackagesButtonClicked);
+ this.clearPackagesCacheButton.Clicked += new global::System.EventHandler (this.ClearPackagesCacheButtonClicked);
+ this.browseButton.Clicked += new global::System.EventHandler (this.BrowseButtonClicked);
+ this.restorePackagesCheckBox.Toggled += new global::System.EventHandler (this.RestorePackagesCheckBoxToggled);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageSourcesWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageSourcesWidget.cs
new file mode 100644
index 0000000000..be9c487e30
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackageSourcesWidget.cs
@@ -0,0 +1,216 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.PackageManagement
+{
+ public partial class PackageSourcesWidget
+ {
+ private global::Gtk.VBox mainVBox;
+ private global::Gtk.HBox packageSourceListHBox;
+ private global::Gtk.ScrolledWindow GtkScrolledWindow;
+ private global::Gtk.TreeView packageSourcesTreeView;
+ private global::Gtk.VButtonBox moveButtonsBox;
+ private global::Gtk.Button moveUpButton;
+ private global::Gtk.Button moveDownButton;
+ private global::Gtk.Button removeButton;
+ private global::Gtk.HBox packageSourceHBox;
+ private global::Gtk.VBox packageSourceLabelsHBox;
+ private global::Gtk.Label packageSourceNameLabel;
+ private global::Gtk.Label packageSourceLabel;
+ private global::Gtk.VBox packageSourceTextBoxesVBox;
+ private global::Gtk.Entry packageSourceNameTextBox;
+ private global::Gtk.Entry packageSourceTextBox;
+ private global::Gtk.VButtonBox packageSourceButtonsBox;
+ private global::Gtk.Button addButton;
+ private global::Gtk.Button browseButton;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.PackageManagement.PackageSourcesWidget
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "MonoDevelop.PackageManagement.PackageSourcesWidget";
+ // Container child MonoDevelop.PackageManagement.PackageSourcesWidget.Gtk.Container+ContainerChild
+ this.mainVBox = new global::Gtk.VBox ();
+ this.mainVBox.Name = "mainVBox";
+ this.mainVBox.Spacing = 6;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.packageSourceListHBox = new global::Gtk.HBox ();
+ this.packageSourceListHBox.Name = "packageSourceListHBox";
+ this.packageSourceListHBox.Spacing = 6;
+ // Container child packageSourceListHBox.Gtk.Box+BoxChild
+ this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow.Name = "GtkScrolledWindow";
+ this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
+ this.packageSourcesTreeView = new global::Gtk.TreeView ();
+ this.packageSourcesTreeView.CanFocus = true;
+ this.packageSourcesTreeView.Name = "packageSourcesTreeView";
+ this.packageSourcesTreeView.HeadersVisible = false;
+ this.GtkScrolledWindow.Add (this.packageSourcesTreeView);
+ this.packageSourceListHBox.Add (this.GtkScrolledWindow);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.packageSourceListHBox [this.GtkScrolledWindow]));
+ w2.Position = 0;
+ // Container child packageSourceListHBox.Gtk.Box+BoxChild
+ this.moveButtonsBox = new global::Gtk.VButtonBox ();
+ this.moveButtonsBox.Name = "moveButtonsBox";
+ this.moveButtonsBox.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(3));
+ // Container child moveButtonsBox.Gtk.ButtonBox+ButtonBoxChild
+ this.moveUpButton = new global::Gtk.Button ();
+ this.moveUpButton.Sensitive = false;
+ this.moveUpButton.CanFocus = true;
+ this.moveUpButton.Name = "moveUpButton";
+ this.moveUpButton.UseStock = true;
+ this.moveUpButton.UseUnderline = true;
+ this.moveUpButton.Label = "gtk-go-up";
+ this.moveButtonsBox.Add (this.moveUpButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w3 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.moveButtonsBox [this.moveUpButton]));
+ w3.Expand = false;
+ w3.Fill = false;
+ // Container child moveButtonsBox.Gtk.ButtonBox+ButtonBoxChild
+ this.moveDownButton = new global::Gtk.Button ();
+ this.moveDownButton.Sensitive = false;
+ this.moveDownButton.CanFocus = true;
+ this.moveDownButton.Name = "moveDownButton";
+ this.moveDownButton.UseStock = true;
+ this.moveDownButton.UseUnderline = true;
+ this.moveDownButton.Label = "gtk-go-down";
+ this.moveButtonsBox.Add (this.moveDownButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w4 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.moveButtonsBox [this.moveDownButton]));
+ w4.Position = 1;
+ w4.Expand = false;
+ w4.Fill = false;
+ // Container child moveButtonsBox.Gtk.ButtonBox+ButtonBoxChild
+ this.removeButton = new global::Gtk.Button ();
+ this.removeButton.Sensitive = false;
+ this.removeButton.CanFocus = true;
+ this.removeButton.Name = "removeButton";
+ this.removeButton.UseStock = true;
+ this.removeButton.UseUnderline = true;
+ this.removeButton.Label = "gtk-remove";
+ this.moveButtonsBox.Add (this.removeButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w5 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.moveButtonsBox [this.removeButton]));
+ w5.Position = 2;
+ w5.Expand = false;
+ w5.Fill = false;
+ this.packageSourceListHBox.Add (this.moveButtonsBox);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.packageSourceListHBox [this.moveButtonsBox]));
+ w6.Position = 1;
+ w6.Expand = false;
+ w6.Fill = false;
+ this.mainVBox.Add (this.packageSourceListHBox);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.mainVBox [this.packageSourceListHBox]));
+ w7.Position = 0;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.packageSourceHBox = new global::Gtk.HBox ();
+ this.packageSourceHBox.Name = "packageSourceHBox";
+ this.packageSourceHBox.Spacing = 6;
+ // Container child packageSourceHBox.Gtk.Box+BoxChild
+ this.packageSourceLabelsHBox = new global::Gtk.VBox ();
+ this.packageSourceLabelsHBox.Name = "packageSourceLabelsHBox";
+ this.packageSourceLabelsHBox.Spacing = 6;
+ // Container child packageSourceLabelsHBox.Gtk.Box+BoxChild
+ this.packageSourceNameLabel = new global::Gtk.Label ();
+ this.packageSourceNameLabel.Name = "packageSourceNameLabel";
+ this.packageSourceNameLabel.Ypad = 4;
+ this.packageSourceNameLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Name:");
+ this.packageSourceLabelsHBox.Add (this.packageSourceNameLabel);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.packageSourceLabelsHBox [this.packageSourceNameLabel]));
+ w8.Position = 0;
+ w8.Expand = false;
+ w8.Fill = false;
+ // Container child packageSourceLabelsHBox.Gtk.Box+BoxChild
+ this.packageSourceLabel = new global::Gtk.Label ();
+ this.packageSourceLabel.Name = "packageSourceLabel";
+ this.packageSourceLabel.Ypad = 4;
+ this.packageSourceLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Source:");
+ this.packageSourceLabelsHBox.Add (this.packageSourceLabel);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.packageSourceLabelsHBox [this.packageSourceLabel]));
+ w9.Position = 1;
+ w9.Expand = false;
+ w9.Fill = false;
+ this.packageSourceHBox.Add (this.packageSourceLabelsHBox);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.packageSourceHBox [this.packageSourceLabelsHBox]));
+ w10.Position = 0;
+ w10.Expand = false;
+ w10.Fill = false;
+ // Container child packageSourceHBox.Gtk.Box+BoxChild
+ this.packageSourceTextBoxesVBox = new global::Gtk.VBox ();
+ this.packageSourceTextBoxesVBox.Name = "packageSourceTextBoxesVBox";
+ this.packageSourceTextBoxesVBox.Spacing = 6;
+ // Container child packageSourceTextBoxesVBox.Gtk.Box+BoxChild
+ this.packageSourceNameTextBox = new global::Gtk.Entry ();
+ this.packageSourceNameTextBox.CanFocus = true;
+ this.packageSourceNameTextBox.Name = "packageSourceNameTextBox";
+ this.packageSourceNameTextBox.IsEditable = true;
+ this.packageSourceNameTextBox.InvisibleChar = '●';
+ this.packageSourceTextBoxesVBox.Add (this.packageSourceNameTextBox);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.packageSourceTextBoxesVBox [this.packageSourceNameTextBox]));
+ w11.Position = 0;
+ w11.Expand = false;
+ w11.Fill = false;
+ // Container child packageSourceTextBoxesVBox.Gtk.Box+BoxChild
+ this.packageSourceTextBox = new global::Gtk.Entry ();
+ this.packageSourceTextBox.CanFocus = true;
+ this.packageSourceTextBox.Name = "packageSourceTextBox";
+ this.packageSourceTextBox.IsEditable = true;
+ this.packageSourceTextBox.InvisibleChar = '●';
+ this.packageSourceTextBoxesVBox.Add (this.packageSourceTextBox);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.packageSourceTextBoxesVBox [this.packageSourceTextBox]));
+ w12.Position = 1;
+ w12.Expand = false;
+ w12.Fill = false;
+ this.packageSourceHBox.Add (this.packageSourceTextBoxesVBox);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.packageSourceHBox [this.packageSourceTextBoxesVBox]));
+ w13.Position = 1;
+ // Container child packageSourceHBox.Gtk.Box+BoxChild
+ this.packageSourceButtonsBox = new global::Gtk.VButtonBox ();
+ this.packageSourceButtonsBox.Name = "packageSourceButtonsBox";
+ this.packageSourceButtonsBox.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(3));
+ // Container child packageSourceButtonsBox.Gtk.ButtonBox+ButtonBoxChild
+ this.addButton = new global::Gtk.Button ();
+ this.addButton.Sensitive = false;
+ this.addButton.CanFocus = true;
+ this.addButton.Name = "addButton";
+ this.addButton.UseStock = true;
+ this.addButton.UseUnderline = true;
+ this.addButton.Label = "gtk-add";
+ this.packageSourceButtonsBox.Add (this.addButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.packageSourceButtonsBox [this.addButton]));
+ w14.Expand = false;
+ w14.Fill = false;
+ // Container child packageSourceButtonsBox.Gtk.ButtonBox+ButtonBoxChild
+ this.browseButton = new global::Gtk.Button ();
+ this.browseButton.CanFocus = true;
+ this.browseButton.Name = "browseButton";
+ this.browseButton.UseUnderline = true;
+ this.browseButton.Label = global::Mono.Unix.Catalog.GetString ("_Browse...");
+ this.packageSourceButtonsBox.Add (this.browseButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w15 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.packageSourceButtonsBox [this.browseButton]));
+ w15.Position = 1;
+ w15.Expand = false;
+ w15.Fill = false;
+ this.packageSourceHBox.Add (this.packageSourceButtonsBox);
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.packageSourceHBox [this.packageSourceButtonsBox]));
+ w16.Position = 2;
+ w16.Expand = false;
+ w16.Fill = false;
+ this.mainVBox.Add (this.packageSourceHBox);
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.mainVBox [this.packageSourceHBox]));
+ w17.Position = 1;
+ w17.Expand = false;
+ w17.Fill = false;
+ this.Add (this.mainVBox);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Hide ();
+ this.moveUpButton.Clicked += new global::System.EventHandler (this.MoveUpButtonClicked);
+ this.moveDownButton.Clicked += new global::System.EventHandler (this.MoveDownButtonClicked);
+ this.removeButton.Clicked += new global::System.EventHandler (this.RemoveButtonClicked);
+ this.packageSourceNameTextBox.Changed += new global::System.EventHandler (this.PackageSourceNameTextBoxChanged);
+ this.packageSourceTextBox.Changed += new global::System.EventHandler (this.PackageSourceTextBoxChanged);
+ this.addButton.Clicked += new global::System.EventHandler (this.AddButtonClicked);
+ this.browseButton.Clicked += new global::System.EventHandler (this.BrowseButtonClicked);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackagesWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackagesWidget.cs
new file mode 100644
index 0000000000..4fbab13167
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PackagesWidget.cs
@@ -0,0 +1,539 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.PackageManagement
+{
+ public partial class PackagesWidget
+ {
+ private global::Gtk.HPaned mainPane;
+ private global::Gtk.VBox packagesListVBox;
+ private global::Gtk.ScrolledWindow packagesTreeScrolledWindow;
+ private global::Gtk.TreeView packagesTreeView;
+ private global::Gtk.HBox pagedResultsHBox;
+ private global::Gtk.Label pagedResultsLeftLabel;
+ private global::MonoDevelop.PackageManagement.PagedResultsWidget pagedResultsWidget;
+ private global::Gtk.Label pagedResultsRightLabel;
+ private global::Gtk.VBox packageInfoVBox;
+ private global::Gtk.ComboBox packageSourceComboBox;
+ private global::Gtk.HBox packageSearchHBox;
+ private global::Gtk.Entry packageSearchEntry;
+ private global::Gtk.Button packageSearchButton;
+ private global::Gtk.CheckButton includePrereleaseCheckButton;
+ private global::Gtk.HButtonBox updateAllPackagesButtonBox;
+ private global::Gtk.Button updateAllPackagesButton;
+ private global::Gtk.Frame packageInfoFrame;
+ private global::Gtk.Alignment packageInfoFrameAlignment;
+ private global::Gtk.ScrolledWindow GtkScrolledWindow;
+ private global::Gtk.VBox packageInfoFrameVBox;
+ private global::Gtk.HBox packageCreatedByHBox;
+ private global::Gtk.Label packageCreatedByLabel;
+ private global::Gtk.Label packageCreatedByTextBox;
+ private global::Gtk.HBox packageIdHBox;
+ private global::Gtk.Label packageIdLabel;
+ private global::MonoDevelop.PackageManagement.HyperlinkWidget packageIdButton;
+ private global::Gtk.Label packageIdTextBox;
+ private global::Gtk.HBox packageVersionHBox;
+ private global::Gtk.Label packageVersionLabel;
+ private global::Gtk.Label packageVersionTextBox;
+ private global::Gtk.HBox packageLastUpdatedHBox;
+ private global::Gtk.Label packageLastUpdatedLabel;
+ private global::Gtk.Label packageLastUpdatedTextBox;
+ private global::Gtk.HBox packageDownloadsHBox;
+ private global::Gtk.Label packageDownloadsLabel;
+ private global::Gtk.Label packageDownloadsTextBox;
+ private global::Gtk.HBox viewLicenseTermsHBox;
+ private global::MonoDevelop.PackageManagement.HyperlinkWidget viewLicenseTermsButton;
+ private global::Gtk.HBox moreInformationHBox;
+ private global::MonoDevelop.PackageManagement.HyperlinkWidget moreInformationButton;
+ private global::Gtk.TextView packageDescriptionTextView;
+ private global::Gtk.HBox packageDependenciesHBox;
+ private global::Gtk.Label packageDependenciesLabel;
+ private global::Gtk.Label packageDependenciesNoneLabel;
+ private global::Gtk.HBox packageDependenciesListHBox;
+ private global::Gtk.Label packageDependenciesListLabel;
+ private global::Gtk.Label packageDependenciesListFillerLabel;
+ private global::Gtk.HButtonBox managePackageButtonBox;
+ private global::Gtk.Button addPackageButton;
+ private global::Gtk.Button removePackageButton;
+ private global::Gtk.Button managePackageButton;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.PackageManagement.PackagesWidget
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "MonoDevelop.PackageManagement.PackagesWidget";
+ // Container child MonoDevelop.PackageManagement.PackagesWidget.Gtk.Container+ContainerChild
+ this.mainPane = new global::Gtk.HPaned ();
+ this.mainPane.CanFocus = true;
+ this.mainPane.Name = "mainPane";
+ this.mainPane.Position = 322;
+ // Container child mainPane.Gtk.Paned+PanedChild
+ this.packagesListVBox = new global::Gtk.VBox ();
+ this.packagesListVBox.Name = "packagesListVBox";
+ this.packagesListVBox.Spacing = 6;
+ // Container child packagesListVBox.Gtk.Box+BoxChild
+ this.packagesTreeScrolledWindow = new global::Gtk.ScrolledWindow ();
+ this.packagesTreeScrolledWindow.Name = "packagesTreeScrolledWindow";
+ this.packagesTreeScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child packagesTreeScrolledWindow.Gtk.Container+ContainerChild
+ this.packagesTreeView = new global::Gtk.TreeView ();
+ this.packagesTreeView.CanFocus = true;
+ this.packagesTreeView.Name = "packagesTreeView";
+ this.packagesTreeView.EnableSearch = false;
+ this.packagesTreeView.HeadersVisible = false;
+ this.packagesTreeScrolledWindow.Add (this.packagesTreeView);
+ this.packagesListVBox.Add (this.packagesTreeScrolledWindow);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.packagesListVBox [this.packagesTreeScrolledWindow]));
+ w2.Position = 0;
+ // Container child packagesListVBox.Gtk.Box+BoxChild
+ this.pagedResultsHBox = new global::Gtk.HBox ();
+ this.pagedResultsHBox.Name = "pagedResultsHBox";
+ this.pagedResultsHBox.Spacing = 6;
+ // Container child pagedResultsHBox.Gtk.Box+BoxChild
+ this.pagedResultsLeftLabel = new global::Gtk.Label ();
+ this.pagedResultsLeftLabel.Name = "pagedResultsLeftLabel";
+ this.pagedResultsHBox.Add (this.pagedResultsLeftLabel);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.pagedResultsHBox [this.pagedResultsLeftLabel]));
+ w3.Position = 0;
+ // Container child pagedResultsHBox.Gtk.Box+BoxChild
+ this.pagedResultsWidget = new global::MonoDevelop.PackageManagement.PagedResultsWidget ();
+ this.pagedResultsWidget.Events = ((global::Gdk.EventMask)(256));
+ this.pagedResultsWidget.Name = "pagedResultsWidget";
+ this.pagedResultsHBox.Add (this.pagedResultsWidget);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.pagedResultsHBox [this.pagedResultsWidget]));
+ w4.Position = 1;
+ w4.Expand = false;
+ w4.Fill = false;
+ // Container child pagedResultsHBox.Gtk.Box+BoxChild
+ this.pagedResultsRightLabel = new global::Gtk.Label ();
+ this.pagedResultsRightLabel.Name = "pagedResultsRightLabel";
+ this.pagedResultsHBox.Add (this.pagedResultsRightLabel);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.pagedResultsHBox [this.pagedResultsRightLabel]));
+ w5.Position = 2;
+ this.packagesListVBox.Add (this.pagedResultsHBox);
+ global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.packagesListVBox [this.pagedResultsHBox]));
+ w6.Position = 1;
+ w6.Expand = false;
+ w6.Fill = false;
+ this.mainPane.Add (this.packagesListVBox);
+ global::Gtk.Paned.PanedChild w7 = ((global::Gtk.Paned.PanedChild)(this.mainPane [this.packagesListVBox]));
+ w7.Resize = false;
+ // Container child mainPane.Gtk.Paned+PanedChild
+ this.packageInfoVBox = new global::Gtk.VBox ();
+ this.packageInfoVBox.Name = "packageInfoVBox";
+ this.packageInfoVBox.Spacing = 6;
+ // Container child packageInfoVBox.Gtk.Box+BoxChild
+ this.packageSourceComboBox = global::Gtk.ComboBox.NewText ();
+ this.packageSourceComboBox.Name = "packageSourceComboBox";
+ this.packageInfoVBox.Add (this.packageSourceComboBox);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.packageInfoVBox [this.packageSourceComboBox]));
+ w8.Position = 0;
+ w8.Expand = false;
+ w8.Fill = false;
+ // Container child packageInfoVBox.Gtk.Box+BoxChild
+ this.packageSearchHBox = new global::Gtk.HBox ();
+ this.packageSearchHBox.Name = "packageSearchHBox";
+ this.packageSearchHBox.Spacing = 6;
+ // Container child packageSearchHBox.Gtk.Box+BoxChild
+ this.packageSearchEntry = new global::Gtk.Entry ();
+ this.packageSearchEntry.CanFocus = true;
+ this.packageSearchEntry.Name = "packageSearchEntry";
+ this.packageSearchEntry.IsEditable = true;
+ this.packageSearchEntry.InvisibleChar = '●';
+ this.packageSearchHBox.Add (this.packageSearchEntry);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.packageSearchHBox [this.packageSearchEntry]));
+ w9.Position = 0;
+ // Container child packageSearchHBox.Gtk.Box+BoxChild
+ this.packageSearchButton = new global::Gtk.Button ();
+ this.packageSearchButton.CanFocus = true;
+ this.packageSearchButton.Name = "packageSearchButton";
+ this.packageSearchButton.UseUnderline = true;
+ // Container child packageSearchButton.Gtk.Container+ContainerChild
+ global::Gtk.Alignment w10 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
+ global::Gtk.HBox w11 = new global::Gtk.HBox ();
+ w11.Spacing = 2;
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ global::Gtk.Image w12 = new global::Gtk.Image ();
+ w12.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-find", global::Gtk.IconSize.Menu);
+ w11.Add (w12);
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ global::Gtk.Label w14 = new global::Gtk.Label ();
+ w11.Add (w14);
+ w10.Add (w11);
+ this.packageSearchButton.Add (w10);
+ this.packageSearchHBox.Add (this.packageSearchButton);
+ global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.packageSearchHBox [this.packageSearchButton]));
+ w18.Position = 1;
+ w18.Expand = false;
+ w18.Fill = false;
+ this.packageInfoVBox.Add (this.packageSearchHBox);
+ global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.packageInfoVBox [this.packageSearchHBox]));
+ w19.Position = 1;
+ w19.Expand = false;
+ w19.Fill = false;
+ // Container child packageInfoVBox.Gtk.Box+BoxChild
+ this.includePrereleaseCheckButton = new global::Gtk.CheckButton ();
+ this.includePrereleaseCheckButton.CanFocus = true;
+ this.includePrereleaseCheckButton.Name = "includePrereleaseCheckButton";
+ this.includePrereleaseCheckButton.Label = global::Mono.Unix.Catalog.GetString ("Include Prerelease");
+ this.includePrereleaseCheckButton.DrawIndicator = true;
+ this.includePrereleaseCheckButton.UseUnderline = true;
+ this.packageInfoVBox.Add (this.includePrereleaseCheckButton);
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.packageInfoVBox [this.includePrereleaseCheckButton]));
+ w20.Position = 2;
+ w20.Expand = false;
+ w20.Fill = false;
+ // Container child packageInfoVBox.Gtk.Box+BoxChild
+ this.updateAllPackagesButtonBox = new global::Gtk.HButtonBox ();
+ this.updateAllPackagesButtonBox.Name = "updateAllPackagesButtonBox";
+ this.updateAllPackagesButtonBox.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ // Container child updateAllPackagesButtonBox.Gtk.ButtonBox+ButtonBoxChild
+ this.updateAllPackagesButton = new global::Gtk.Button ();
+ this.updateAllPackagesButton.CanFocus = true;
+ this.updateAllPackagesButton.Name = "updateAllPackagesButton";
+ this.updateAllPackagesButton.UseUnderline = true;
+ this.updateAllPackagesButton.Label = global::Mono.Unix.Catalog.GetString ("Update All");
+ this.updateAllPackagesButtonBox.Add (this.updateAllPackagesButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w21 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.updateAllPackagesButtonBox [this.updateAllPackagesButton]));
+ w21.Expand = false;
+ w21.Fill = false;
+ this.packageInfoVBox.Add (this.updateAllPackagesButtonBox);
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.packageInfoVBox [this.updateAllPackagesButtonBox]));
+ w22.Position = 3;
+ w22.Expand = false;
+ w22.Fill = false;
+ // Container child packageInfoVBox.Gtk.Box+BoxChild
+ this.packageInfoFrame = new global::Gtk.Frame ();
+ this.packageInfoFrame.Name = "packageInfoFrame";
+ this.packageInfoFrame.ShadowType = ((global::Gtk.ShadowType)(0));
+ this.packageInfoFrame.LabelYalign = 0F;
+ // Container child packageInfoFrame.Gtk.Container+ContainerChild
+ this.packageInfoFrameAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
+ this.packageInfoFrameAlignment.Name = "packageInfoFrameAlignment";
+ // Container child packageInfoFrameAlignment.Gtk.Container+ContainerChild
+ this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow.Name = "GtkScrolledWindow";
+ this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
+ global::Gtk.Viewport w23 = new global::Gtk.Viewport ();
+ w23.ShadowType = ((global::Gtk.ShadowType)(0));
+ // Container child GtkViewport.Gtk.Container+ContainerChild
+ this.packageInfoFrameVBox = new global::Gtk.VBox ();
+ this.packageInfoFrameVBox.Name = "packageInfoFrameVBox";
+ this.packageInfoFrameVBox.Spacing = 6;
+ // Container child packageInfoFrameVBox.Gtk.Box+BoxChild
+ this.packageCreatedByHBox = new global::Gtk.HBox ();
+ this.packageCreatedByHBox.Name = "packageCreatedByHBox";
+ this.packageCreatedByHBox.Spacing = 6;
+ // Container child packageCreatedByHBox.Gtk.Box+BoxChild
+ this.packageCreatedByLabel = new global::Gtk.Label ();
+ this.packageCreatedByLabel.Name = "packageCreatedByLabel";
+ this.packageCreatedByLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Created by:</span>");
+ this.packageCreatedByLabel.UseMarkup = true;
+ this.packageCreatedByHBox.Add (this.packageCreatedByLabel);
+ global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.packageCreatedByHBox [this.packageCreatedByLabel]));
+ w24.Position = 0;
+ w24.Expand = false;
+ w24.Fill = false;
+ // Container child packageCreatedByHBox.Gtk.Box+BoxChild
+ this.packageCreatedByTextBox = new global::Gtk.Label ();
+ this.packageCreatedByTextBox.Name = "packageCreatedByTextBox";
+ this.packageCreatedByTextBox.Selectable = true;
+ this.packageCreatedByHBox.Add (this.packageCreatedByTextBox);
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.packageCreatedByHBox [this.packageCreatedByTextBox]));
+ w25.Position = 1;
+ w25.Expand = false;
+ w25.Fill = false;
+ this.packageInfoFrameVBox.Add (this.packageCreatedByHBox);
+ global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.packageInfoFrameVBox [this.packageCreatedByHBox]));
+ w26.Position = 0;
+ w26.Expand = false;
+ w26.Fill = false;
+ // Container child packageInfoFrameVBox.Gtk.Box+BoxChild
+ this.packageIdHBox = new global::Gtk.HBox ();
+ this.packageIdHBox.Name = "packageIdHBox";
+ this.packageIdHBox.Spacing = 6;
+ // Container child packageIdHBox.Gtk.Box+BoxChild
+ this.packageIdLabel = new global::Gtk.Label ();
+ this.packageIdLabel.Name = "packageIdLabel";
+ this.packageIdLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Id:</span>");
+ this.packageIdLabel.UseMarkup = true;
+ this.packageIdHBox.Add (this.packageIdLabel);
+ global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.packageIdHBox [this.packageIdLabel]));
+ w27.Position = 0;
+ w27.Expand = false;
+ w27.Fill = false;
+ // Container child packageIdHBox.Gtk.Box+BoxChild
+ this.packageIdButton = new global::MonoDevelop.PackageManagement.HyperlinkWidget ();
+ this.packageIdButton.Events = ((global::Gdk.EventMask)(256));
+ this.packageIdButton.Name = "packageIdButton";
+ this.packageIdHBox.Add (this.packageIdButton);
+ global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.packageIdHBox [this.packageIdButton]));
+ w28.Position = 1;
+ // Container child packageIdHBox.Gtk.Box+BoxChild
+ this.packageIdTextBox = new global::Gtk.Label ();
+ this.packageIdTextBox.Name = "packageIdTextBox";
+ this.packageIdTextBox.Selectable = true;
+ this.packageIdHBox.Add (this.packageIdTextBox);
+ global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.packageIdHBox [this.packageIdTextBox]));
+ w29.Position = 2;
+ w29.Expand = false;
+ w29.Fill = false;
+ this.packageInfoFrameVBox.Add (this.packageIdHBox);
+ global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.packageInfoFrameVBox [this.packageIdHBox]));
+ w30.Position = 1;
+ w30.Expand = false;
+ w30.Fill = false;
+ // Container child packageInfoFrameVBox.Gtk.Box+BoxChild
+ this.packageVersionHBox = new global::Gtk.HBox ();
+ this.packageVersionHBox.Name = "packageVersionHBox";
+ this.packageVersionHBox.Spacing = 6;
+ // Container child packageVersionHBox.Gtk.Box+BoxChild
+ this.packageVersionLabel = new global::Gtk.Label ();
+ this.packageVersionLabel.Name = "packageVersionLabel";
+ this.packageVersionLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Version:</span>");
+ this.packageVersionLabel.UseMarkup = true;
+ this.packageVersionHBox.Add (this.packageVersionLabel);
+ global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.packageVersionHBox [this.packageVersionLabel]));
+ w31.Position = 0;
+ w31.Expand = false;
+ w31.Fill = false;
+ // Container child packageVersionHBox.Gtk.Box+BoxChild
+ this.packageVersionTextBox = new global::Gtk.Label ();
+ this.packageVersionTextBox.Name = "packageVersionTextBox";
+ this.packageVersionTextBox.Selectable = true;
+ this.packageVersionHBox.Add (this.packageVersionTextBox);
+ global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.packageVersionHBox [this.packageVersionTextBox]));
+ w32.Position = 1;
+ w32.Expand = false;
+ w32.Fill = false;
+ this.packageInfoFrameVBox.Add (this.packageVersionHBox);
+ global::Gtk.Box.BoxChild w33 = ((global::Gtk.Box.BoxChild)(this.packageInfoFrameVBox [this.packageVersionHBox]));
+ w33.Position = 2;
+ w33.Expand = false;
+ w33.Fill = false;
+ // Container child packageInfoFrameVBox.Gtk.Box+BoxChild
+ this.packageLastUpdatedHBox = new global::Gtk.HBox ();
+ this.packageLastUpdatedHBox.Name = "packageLastUpdatedHBox";
+ this.packageLastUpdatedHBox.Spacing = 6;
+ // Container child packageLastUpdatedHBox.Gtk.Box+BoxChild
+ this.packageLastUpdatedLabel = new global::Gtk.Label ();
+ this.packageLastUpdatedLabel.Name = "packageLastUpdatedLabel";
+ this.packageLastUpdatedLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Last Updated:</span>");
+ this.packageLastUpdatedLabel.UseMarkup = true;
+ this.packageLastUpdatedHBox.Add (this.packageLastUpdatedLabel);
+ global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.packageLastUpdatedHBox [this.packageLastUpdatedLabel]));
+ w34.Position = 0;
+ w34.Expand = false;
+ w34.Fill = false;
+ // Container child packageLastUpdatedHBox.Gtk.Box+BoxChild
+ this.packageLastUpdatedTextBox = new global::Gtk.Label ();
+ this.packageLastUpdatedTextBox.Name = "packageLastUpdatedTextBox";
+ this.packageLastUpdatedTextBox.Selectable = true;
+ this.packageLastUpdatedHBox.Add (this.packageLastUpdatedTextBox);
+ global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.packageLastUpdatedHBox [this.packageLastUpdatedTextBox]));
+ w35.Position = 1;
+ w35.Expand = false;
+ w35.Fill = false;
+ this.packageInfoFrameVBox.Add (this.packageLastUpdatedHBox);
+ global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.packageInfoFrameVBox [this.packageLastUpdatedHBox]));
+ w36.Position = 3;
+ w36.Expand = false;
+ w36.Fill = false;
+ // Container child packageInfoFrameVBox.Gtk.Box+BoxChild
+ this.packageDownloadsHBox = new global::Gtk.HBox ();
+ this.packageDownloadsHBox.Name = "packageDownloadsHBox";
+ this.packageDownloadsHBox.Spacing = 6;
+ // Container child packageDownloadsHBox.Gtk.Box+BoxChild
+ this.packageDownloadsLabel = new global::Gtk.Label ();
+ this.packageDownloadsLabel.Name = "packageDownloadsLabel";
+ this.packageDownloadsLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Downloads:</span>");
+ this.packageDownloadsLabel.UseMarkup = true;
+ this.packageDownloadsHBox.Add (this.packageDownloadsLabel);
+ global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.packageDownloadsHBox [this.packageDownloadsLabel]));
+ w37.Position = 0;
+ w37.Expand = false;
+ w37.Fill = false;
+ // Container child packageDownloadsHBox.Gtk.Box+BoxChild
+ this.packageDownloadsTextBox = new global::Gtk.Label ();
+ this.packageDownloadsTextBox.Name = "packageDownloadsTextBox";
+ this.packageDownloadsTextBox.Selectable = true;
+ this.packageDownloadsHBox.Add (this.packageDownloadsTextBox);
+ global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.packageDownloadsHBox [this.packageDownloadsTextBox]));
+ w38.Position = 1;
+ w38.Expand = false;
+ w38.Fill = false;
+ this.packageInfoFrameVBox.Add (this.packageDownloadsHBox);
+ global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.packageInfoFrameVBox [this.packageDownloadsHBox]));
+ w39.Position = 4;
+ w39.Expand = false;
+ w39.Fill = false;
+ // Container child packageInfoFrameVBox.Gtk.Box+BoxChild
+ this.viewLicenseTermsHBox = new global::Gtk.HBox ();
+ this.viewLicenseTermsHBox.Name = "viewLicenseTermsHBox";
+ this.viewLicenseTermsHBox.Spacing = 6;
+ // Container child viewLicenseTermsHBox.Gtk.Box+BoxChild
+ this.viewLicenseTermsButton = new global::MonoDevelop.PackageManagement.HyperlinkWidget ();
+ this.viewLicenseTermsButton.Events = ((global::Gdk.EventMask)(256));
+ this.viewLicenseTermsButton.Name = "viewLicenseTermsButton";
+ this.viewLicenseTermsButton.Uri = "";
+ this.viewLicenseTermsButton.Label = "View License Terms";
+ this.viewLicenseTermsHBox.Add (this.viewLicenseTermsButton);
+ global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.viewLicenseTermsHBox [this.viewLicenseTermsButton]));
+ w40.Position = 0;
+ this.packageInfoFrameVBox.Add (this.viewLicenseTermsHBox);
+ global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.packageInfoFrameVBox [this.viewLicenseTermsHBox]));
+ w41.Position = 5;
+ w41.Expand = false;
+ w41.Fill = false;
+ // Container child packageInfoFrameVBox.Gtk.Box+BoxChild
+ this.moreInformationHBox = new global::Gtk.HBox ();
+ this.moreInformationHBox.Name = "moreInformationHBox";
+ // Container child moreInformationHBox.Gtk.Box+BoxChild
+ this.moreInformationButton = new global::MonoDevelop.PackageManagement.HyperlinkWidget ();
+ this.moreInformationButton.Events = ((global::Gdk.EventMask)(256));
+ this.moreInformationButton.Name = "moreInformationButton";
+ this.moreInformationButton.Uri = "";
+ this.moreInformationButton.Label = "More Information";
+ this.moreInformationHBox.Add (this.moreInformationButton);
+ global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.moreInformationHBox [this.moreInformationButton]));
+ w42.Position = 0;
+ this.packageInfoFrameVBox.Add (this.moreInformationHBox);
+ global::Gtk.Box.BoxChild w43 = ((global::Gtk.Box.BoxChild)(this.packageInfoFrameVBox [this.moreInformationHBox]));
+ w43.Position = 6;
+ w43.Expand = false;
+ // Container child packageInfoFrameVBox.Gtk.Box+BoxChild
+ this.packageDescriptionTextView = new global::Gtk.TextView ();
+ this.packageDescriptionTextView.CanFocus = true;
+ this.packageDescriptionTextView.Name = "packageDescriptionTextView";
+ this.packageDescriptionTextView.Editable = false;
+ this.packageDescriptionTextView.CursorVisible = false;
+ this.packageDescriptionTextView.WrapMode = ((global::Gtk.WrapMode)(2));
+ this.packageInfoFrameVBox.Add (this.packageDescriptionTextView);
+ global::Gtk.Box.BoxChild w44 = ((global::Gtk.Box.BoxChild)(this.packageInfoFrameVBox [this.packageDescriptionTextView]));
+ w44.Position = 7;
+ // Container child packageInfoFrameVBox.Gtk.Box+BoxChild
+ this.packageDependenciesHBox = new global::Gtk.HBox ();
+ this.packageDependenciesHBox.Name = "packageDependenciesHBox";
+ this.packageDependenciesHBox.Spacing = 6;
+ // Container child packageDependenciesHBox.Gtk.Box+BoxChild
+ this.packageDependenciesLabel = new global::Gtk.Label ();
+ this.packageDependenciesLabel.Name = "packageDependenciesLabel";
+ this.packageDependenciesLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<span weight=\'bold\'>Dependencies:</span>");
+ this.packageDependenciesLabel.UseMarkup = true;
+ this.packageDependenciesHBox.Add (this.packageDependenciesLabel);
+ global::Gtk.Box.BoxChild w45 = ((global::Gtk.Box.BoxChild)(this.packageDependenciesHBox [this.packageDependenciesLabel]));
+ w45.Position = 0;
+ w45.Expand = false;
+ w45.Fill = false;
+ // Container child packageDependenciesHBox.Gtk.Box+BoxChild
+ this.packageDependenciesNoneLabel = new global::Gtk.Label ();
+ this.packageDependenciesNoneLabel.Name = "packageDependenciesNoneLabel";
+ this.packageDependenciesNoneLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("None");
+ this.packageDependenciesNoneLabel.Selectable = true;
+ this.packageDependenciesHBox.Add (this.packageDependenciesNoneLabel);
+ global::Gtk.Box.BoxChild w46 = ((global::Gtk.Box.BoxChild)(this.packageDependenciesHBox [this.packageDependenciesNoneLabel]));
+ w46.Position = 1;
+ w46.Expand = false;
+ w46.Fill = false;
+ this.packageInfoFrameVBox.Add (this.packageDependenciesHBox);
+ global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.packageInfoFrameVBox [this.packageDependenciesHBox]));
+ w47.Position = 8;
+ w47.Expand = false;
+ w47.Fill = false;
+ // Container child packageInfoFrameVBox.Gtk.Box+BoxChild
+ this.packageDependenciesListHBox = new global::Gtk.HBox ();
+ this.packageDependenciesListHBox.Name = "packageDependenciesListHBox";
+ this.packageDependenciesListHBox.Spacing = 6;
+ this.packageDependenciesListHBox.BorderWidth = ((uint)(2));
+ // Container child packageDependenciesListHBox.Gtk.Box+BoxChild
+ this.packageDependenciesListLabel = new global::Gtk.Label ();
+ this.packageDependenciesListLabel.Name = "packageDependenciesListLabel";
+ this.packageDependenciesListLabel.UseMarkup = true;
+ this.packageDependenciesListHBox.Add (this.packageDependenciesListLabel);
+ global::Gtk.Box.BoxChild w48 = ((global::Gtk.Box.BoxChild)(this.packageDependenciesListHBox [this.packageDependenciesListLabel]));
+ w48.Position = 0;
+ w48.Expand = false;
+ w48.Fill = false;
+ // Container child packageDependenciesListHBox.Gtk.Box+BoxChild
+ this.packageDependenciesListFillerLabel = new global::Gtk.Label ();
+ this.packageDependenciesListFillerLabel.Name = "packageDependenciesListFillerLabel";
+ this.packageDependenciesListFillerLabel.Selectable = true;
+ this.packageDependenciesListHBox.Add (this.packageDependenciesListFillerLabel);
+ global::Gtk.Box.BoxChild w49 = ((global::Gtk.Box.BoxChild)(this.packageDependenciesListHBox [this.packageDependenciesListFillerLabel]));
+ w49.Position = 1;
+ this.packageInfoFrameVBox.Add (this.packageDependenciesListHBox);
+ global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.packageInfoFrameVBox [this.packageDependenciesListHBox]));
+ w50.Position = 9;
+ w50.Expand = false;
+ w50.Fill = false;
+ w23.Add (this.packageInfoFrameVBox);
+ this.GtkScrolledWindow.Add (w23);
+ this.packageInfoFrameAlignment.Add (this.GtkScrolledWindow);
+ this.packageInfoFrame.Add (this.packageInfoFrameAlignment);
+ this.packageInfoVBox.Add (this.packageInfoFrame);
+ global::Gtk.Box.BoxChild w55 = ((global::Gtk.Box.BoxChild)(this.packageInfoVBox [this.packageInfoFrame]));
+ w55.Position = 4;
+ // Container child packageInfoVBox.Gtk.Box+BoxChild
+ this.managePackageButtonBox = new global::Gtk.HButtonBox ();
+ this.managePackageButtonBox.Name = "managePackageButtonBox";
+ this.managePackageButtonBox.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(3));
+ // Container child managePackageButtonBox.Gtk.ButtonBox+ButtonBoxChild
+ this.addPackageButton = new global::Gtk.Button ();
+ this.addPackageButton.CanFocus = true;
+ this.addPackageButton.Name = "addPackageButton";
+ this.addPackageButton.UseUnderline = true;
+ this.addPackageButton.Label = global::Mono.Unix.Catalog.GetString ("Add");
+ this.managePackageButtonBox.Add (this.addPackageButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w56 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.managePackageButtonBox [this.addPackageButton]));
+ w56.Expand = false;
+ w56.Fill = false;
+ // Container child managePackageButtonBox.Gtk.ButtonBox+ButtonBoxChild
+ this.removePackageButton = new global::Gtk.Button ();
+ this.removePackageButton.CanFocus = true;
+ this.removePackageButton.Name = "removePackageButton";
+ this.removePackageButton.UseUnderline = true;
+ this.removePackageButton.Label = global::Mono.Unix.Catalog.GetString ("Remove");
+ this.managePackageButtonBox.Add (this.removePackageButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w57 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.managePackageButtonBox [this.removePackageButton]));
+ w57.Position = 1;
+ w57.Expand = false;
+ w57.Fill = false;
+ // Container child managePackageButtonBox.Gtk.ButtonBox+ButtonBoxChild
+ this.managePackageButton = new global::Gtk.Button ();
+ this.managePackageButton.CanFocus = true;
+ this.managePackageButton.Name = "managePackageButton";
+ this.managePackageButton.UseUnderline = true;
+ this.managePackageButton.Label = global::Mono.Unix.Catalog.GetString ("Manage");
+ this.managePackageButtonBox.Add (this.managePackageButton);
+ global::Gtk.ButtonBox.ButtonBoxChild w58 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.managePackageButtonBox [this.managePackageButton]));
+ w58.Position = 2;
+ w58.Expand = false;
+ w58.Fill = false;
+ this.packageInfoVBox.Add (this.managePackageButtonBox);
+ global::Gtk.Box.BoxChild w59 = ((global::Gtk.Box.BoxChild)(this.packageInfoVBox [this.managePackageButtonBox]));
+ w59.PackType = ((global::Gtk.PackType)(1));
+ w59.Position = 5;
+ w59.Expand = false;
+ w59.Fill = false;
+ this.mainPane.Add (this.packageInfoVBox);
+ this.Add (this.mainPane);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.packageInfoFrameVBox.Hide ();
+ this.addPackageButton.Hide ();
+ this.removePackageButton.Hide ();
+ this.managePackageButton.Hide ();
+ this.Hide ();
+ this.packageSourceComboBox.Changed += new global::System.EventHandler (this.PackageSourceChanged);
+ this.packageSearchEntry.Activated += new global::System.EventHandler (this.PackageSearchEntryActivated);
+ this.packageSearchButton.Clicked += new global::System.EventHandler (this.SearchButtonClicked);
+ this.updateAllPackagesButton.Clicked += new global::System.EventHandler (this.UpdateAllPackagesButtonClicked);
+ this.addPackageButton.Clicked += new global::System.EventHandler (this.OnAddPackageButtonClicked);
+ this.removePackageButton.Clicked += new global::System.EventHandler (this.RemovePackageButtonClicked);
+ this.managePackageButton.Clicked += new global::System.EventHandler (this.ManagePackagesButtonClicked);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PagedResultsWidget.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PagedResultsWidget.cs
new file mode 100644
index 0000000000..f5a6ed5f2a
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.PagedResultsWidget.cs
@@ -0,0 +1,150 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.PackageManagement
+{
+ public partial class PagedResultsWidget
+ {
+ private global::Gtk.HBox mainHBox;
+ private global::Gtk.Button backButton;
+ private global::Gtk.Button firstButton;
+ private global::Gtk.Button secondButton;
+ private global::Gtk.Button thirdButton;
+ private global::Gtk.Button fourthButton;
+ private global::Gtk.Button fifthButton;
+ private global::Gtk.Button forwardButton;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.PackageManagement.PagedResultsWidget
+ global::Stetic.BinContainer.Attach (this);
+ this.Name = "MonoDevelop.PackageManagement.PagedResultsWidget";
+ // Container child MonoDevelop.PackageManagement.PagedResultsWidget.Gtk.Container+ContainerChild
+ this.mainHBox = new global::Gtk.HBox ();
+ this.mainHBox.Name = "mainHBox";
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.backButton = new global::Gtk.Button ();
+ this.backButton.CanFocus = true;
+ this.backButton.Name = "backButton";
+ this.backButton.FocusOnClick = false;
+ this.backButton.Relief = ((global::Gtk.ReliefStyle)(2));
+ // Container child backButton.Gtk.Container+ContainerChild
+ global::Gtk.Alignment w1 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
+ global::Gtk.HBox w2 = new global::Gtk.HBox ();
+ w2.Spacing = 2;
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ global::Gtk.Image w3 = new global::Gtk.Image ();
+ w3.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-back", global::Gtk.IconSize.Menu);
+ w2.Add (w3);
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ global::Gtk.Label w5 = new global::Gtk.Label ();
+ w2.Add (w5);
+ w1.Add (w2);
+ this.backButton.Add (w1);
+ this.mainHBox.Add (this.backButton);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.backButton]));
+ w9.Position = 0;
+ w9.Expand = false;
+ w9.Fill = false;
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.firstButton = new global::Gtk.Button ();
+ this.firstButton.CanFocus = true;
+ this.firstButton.Name = "firstButton";
+ this.firstButton.UseUnderline = true;
+ this.firstButton.FocusOnClick = false;
+ this.firstButton.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.firstButton.Label = global::Mono.Unix.Catalog.GetString ("1");
+ this.mainHBox.Add (this.firstButton);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.firstButton]));
+ w10.Position = 1;
+ w10.Expand = false;
+ w10.Fill = false;
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.secondButton = new global::Gtk.Button ();
+ this.secondButton.CanFocus = true;
+ this.secondButton.Name = "secondButton";
+ this.secondButton.FocusOnClick = false;
+ this.secondButton.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.secondButton.Label = global::Mono.Unix.Catalog.GetString ("2");
+ this.mainHBox.Add (this.secondButton);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.secondButton]));
+ w11.Position = 2;
+ w11.Expand = false;
+ w11.Fill = false;
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.thirdButton = new global::Gtk.Button ();
+ this.thirdButton.CanFocus = true;
+ this.thirdButton.Name = "thirdButton";
+ this.thirdButton.FocusOnClick = false;
+ this.thirdButton.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.thirdButton.Label = global::Mono.Unix.Catalog.GetString ("3");
+ this.mainHBox.Add (this.thirdButton);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.thirdButton]));
+ w12.Position = 3;
+ w12.Expand = false;
+ w12.Fill = false;
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.fourthButton = new global::Gtk.Button ();
+ this.fourthButton.CanFocus = true;
+ this.fourthButton.Name = "fourthButton";
+ this.fourthButton.FocusOnClick = false;
+ this.fourthButton.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.fourthButton.Label = global::Mono.Unix.Catalog.GetString ("4");
+ this.mainHBox.Add (this.fourthButton);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.fourthButton]));
+ w13.Position = 4;
+ w13.Expand = false;
+ w13.Fill = false;
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.fifthButton = new global::Gtk.Button ();
+ this.fifthButton.CanFocus = true;
+ this.fifthButton.Name = "fifthButton";
+ this.fifthButton.FocusOnClick = false;
+ this.fifthButton.Relief = ((global::Gtk.ReliefStyle)(2));
+ this.fifthButton.Label = global::Mono.Unix.Catalog.GetString ("5");
+ this.mainHBox.Add (this.fifthButton);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.fifthButton]));
+ w14.Position = 5;
+ w14.Expand = false;
+ w14.Fill = false;
+ // Container child mainHBox.Gtk.Box+BoxChild
+ this.forwardButton = new global::Gtk.Button ();
+ this.forwardButton.CanFocus = true;
+ this.forwardButton.Name = "forwardButton";
+ this.forwardButton.FocusOnClick = false;
+ this.forwardButton.Relief = ((global::Gtk.ReliefStyle)(2));
+ // Container child forwardButton.Gtk.Container+ContainerChild
+ global::Gtk.Alignment w15 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
+ global::Gtk.HBox w16 = new global::Gtk.HBox ();
+ w16.Spacing = 2;
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ global::Gtk.Image w17 = new global::Gtk.Image ();
+ w17.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", global::Gtk.IconSize.Menu);
+ w16.Add (w17);
+ // Container child GtkHBox.Gtk.Container+ContainerChild
+ global::Gtk.Label w19 = new global::Gtk.Label ();
+ w16.Add (w19);
+ w15.Add (w16);
+ this.forwardButton.Add (w15);
+ this.mainHBox.Add (this.forwardButton);
+ global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.mainHBox [this.forwardButton]));
+ w23.Position = 6;
+ w23.Expand = false;
+ w23.Fill = false;
+ this.Add (this.mainHBox);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.Hide ();
+ this.backButton.Clicked += new global::System.EventHandler (this.BackButtonClicked);
+ this.firstButton.Clicked += new global::System.EventHandler (this.PageButtonClicked);
+ this.secondButton.Clicked += new global::System.EventHandler (this.PageButtonClicked);
+ this.thirdButton.Clicked += new global::System.EventHandler (this.PageButtonClicked);
+ this.fourthButton.Clicked += new global::System.EventHandler (this.PageButtonClicked);
+ this.fifthButton.Clicked += new global::System.EventHandler (this.PageButtonClicked);
+ this.forwardButton.Clicked += new global::System.EventHandler (this.ForwardButtonClicked);
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.SelectProjectsDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.SelectProjectsDialog.cs
new file mode 100644
index 0000000000..a82a2f6f5e
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.SelectProjectsDialog.cs
@@ -0,0 +1,95 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace MonoDevelop.PackageManagement
+{
+ public partial class SelectProjectsDialog
+ {
+ private global::Gtk.HBox installLabelHBox;
+ private global::Gtk.Label installLabel;
+ private global::Gtk.ScrolledWindow GtkScrolledWindow;
+ private global::Gtk.TreeView projectsTreeView;
+ private global::Gtk.Button buttonCancel;
+ private global::Gtk.Button buttonOk;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget MonoDevelop.PackageManagement.SelectProjectsDialog
+ this.Name = "MonoDevelop.PackageManagement.SelectProjectsDialog";
+ this.Title = global::Mono.Unix.Catalog.GetString ("Select Projects");
+ this.WindowPosition = ((global::Gtk.WindowPosition)(1));
+ // Internal child MonoDevelop.PackageManagement.SelectProjectsDialog.VBox
+ global::Gtk.VBox w1 = this.VBox;
+ w1.Name = "mainVBox";
+ w1.BorderWidth = ((uint)(2));
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.installLabelHBox = new global::Gtk.HBox ();
+ this.installLabelHBox.Name = "installLabelHBox";
+ this.installLabelHBox.Spacing = 6;
+ // Container child installLabelHBox.Gtk.Box+BoxChild
+ this.installLabel = new global::Gtk.Label ();
+ this.installLabel.Name = "installLabel";
+ this.installLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Install the package into the following projects:");
+ this.installLabelHBox.Add (this.installLabel);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.installLabelHBox [this.installLabel]));
+ w2.Position = 0;
+ w2.Expand = false;
+ w2.Fill = false;
+ w1.Add (this.installLabelHBox);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1 [this.installLabelHBox]));
+ w3.Position = 0;
+ w3.Expand = false;
+ w3.Fill = false;
+ // Container child mainVBox.Gtk.Box+BoxChild
+ this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow.Name = "GtkScrolledWindow";
+ this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
+ this.projectsTreeView = new global::Gtk.TreeView ();
+ this.projectsTreeView.CanFocus = true;
+ this.projectsTreeView.Name = "projectsTreeView";
+ this.projectsTreeView.HeadersVisible = false;
+ this.GtkScrolledWindow.Add (this.projectsTreeView);
+ w1.Add (this.GtkScrolledWindow);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1 [this.GtkScrolledWindow]));
+ w5.Position = 1;
+ // Internal child MonoDevelop.PackageManagement.SelectProjectsDialog.ActionArea
+ global::Gtk.HButtonBox w6 = this.ActionArea;
+ w6.Name = "buttonActionArea";
+ w6.Spacing = 10;
+ w6.BorderWidth = ((uint)(5));
+ w6.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ // Container child buttonActionArea.Gtk.ButtonBox+ButtonBoxChild
+ this.buttonCancel = new global::Gtk.Button ();
+ this.buttonCancel.CanDefault = true;
+ this.buttonCancel.CanFocus = true;
+ this.buttonCancel.Name = "buttonCancel";
+ this.buttonCancel.UseStock = true;
+ this.buttonCancel.UseUnderline = true;
+ this.buttonCancel.Label = "gtk-cancel";
+ this.AddActionWidget (this.buttonCancel, -6);
+ global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.buttonCancel]));
+ w7.Expand = false;
+ w7.Fill = false;
+ // Container child buttonActionArea.Gtk.ButtonBox+ButtonBoxChild
+ this.buttonOk = new global::Gtk.Button ();
+ this.buttonOk.CanDefault = true;
+ this.buttonOk.CanFocus = true;
+ this.buttonOk.Name = "buttonOk";
+ this.buttonOk.UseStock = true;
+ this.buttonOk.UseUnderline = true;
+ this.buttonOk.Label = "gtk-ok";
+ this.AddActionWidget (this.buttonOk, -5);
+ global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w6 [this.buttonOk]));
+ w8.Position = 1;
+ w8.Expand = false;
+ w8.Fill = false;
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ this.DefaultWidth = 400;
+ this.DefaultHeight = 300;
+ this.Show ();
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/generated.cs
new file mode 100644
index 0000000000..feaaa7abe2
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/generated.cs
@@ -0,0 +1,120 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace Stetic
+{
+ internal class Gui
+ {
+ private static bool initialized;
+
+ internal static void Initialize (Gtk.Widget iconRenderer)
+ {
+ if ((Stetic.Gui.initialized == false)) {
+ Stetic.Gui.initialized = true;
+ }
+ }
+ }
+
+ internal class BinContainer
+ {
+ private Gtk.Widget child;
+ private Gtk.UIManager uimanager;
+
+ public static BinContainer Attach (Gtk.Bin bin)
+ {
+ BinContainer bc = new BinContainer ();
+ bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
+ bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
+ bin.Added += new Gtk.AddedHandler (bc.OnAdded);
+ return bc;
+ }
+
+ private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
+ {
+ if ((this.child != null)) {
+ args.Requisition = this.child.SizeRequest ();
+ }
+ }
+
+ private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
+ {
+ if ((this.child != null)) {
+ this.child.Allocation = args.Allocation;
+ }
+ }
+
+ private void OnAdded (object sender, Gtk.AddedArgs args)
+ {
+ this.child = args.Widget;
+ }
+
+ public void SetUiManager (Gtk.UIManager uim)
+ {
+ this.uimanager = uim;
+ this.child.Realized += new System.EventHandler (this.OnRealized);
+ }
+
+ private void OnRealized (object sender, System.EventArgs args)
+ {
+ if ((this.uimanager != null)) {
+ Gtk.Widget w;
+ w = this.child.Toplevel;
+ if (((w != null)
+ && typeof(Gtk.Window).IsInstanceOfType (w))) {
+ ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
+ this.uimanager = null;
+ }
+ }
+ }
+ }
+
+ internal class IconLoader
+ {
+ public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size)
+ {
+ Gdk.Pixbuf res = widget.RenderIcon (name, size, null);
+ if ((res != null)) {
+ return res;
+ } else {
+ int sz;
+ int sy;
+ global::Gtk.Icon.SizeLookup (size, out sz, out sy);
+ try {
+ return Gtk.IconTheme.Default.LoadIcon (name, sz, 0);
+ } catch (System.Exception) {
+ if ((name != "gtk-missing-image")) {
+ return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size);
+ } else {
+ Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz);
+ Gdk.GC gc = new Gdk.GC (pmap);
+ gc.RgbFgColor = new Gdk.Color (255, 255, 255);
+ pmap.DrawRectangle (gc, true, 0, 0, sz, sz);
+ gc.RgbFgColor = new Gdk.Color (0, 0, 0);
+ pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1));
+ gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
+ gc.RgbFgColor = new Gdk.Color (255, 0, 0);
+ pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1)
+ - (sz / 4)), ((sz - 1)
+ - (sz / 4)));
+ pmap.DrawLine (gc, ((sz - 1)
+ - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1)
+ - (sz / 4)));
+ return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
+ }
+ }
+ }
+ }
+ }
+
+ internal class ActionGroups
+ {
+ public static Gtk.ActionGroup GetActionGroup (System.Type type)
+ {
+ return Stetic.ActionGroups.GetActionGroup (type.FullName);
+ }
+
+ public static Gtk.ActionGroup GetActionGroup (string name)
+ {
+ return null;
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/gui.stetic
new file mode 100644
index 0000000000..20723dc1d3
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/gtk-gui/gui.stetic
@@ -0,0 +1,1746 @@
+<?xml version="1.0" encoding="utf-8"?>
+<stetic-interface>
+ <configuration>
+ <images-root-path>..</images-root-path>
+ <target-gtk-version>2.12</target-gtk-version>
+ </configuration>
+ <import>
+ <widget-library name="../../../lib/MonoDevelop.Ide.dll" />
+ <widget-library name="../../../bin/MonoDevelop.PackageManagement.dll" internal="true" />
+ </import>
+ <widget class="Gtk.Dialog" id="MonoDevelop.PackageManagement.ManagePackagesDialog" design-size="581 446">
+ <property name="MemberName" />
+ <property name="Title" translatable="yes">Manage Packages</property>
+ <property name="WindowPosition">Center</property>
+ <property name="DefaultWidth">640</property>
+ <property name="DefaultHeight">480</property>
+ <property name="Buttons">1</property>
+ <property name="HelpButton">False</property>
+ <child internal-child="VBox">
+ <widget class="Gtk.VBox" id="mainVBox">
+ <property name="MemberName" />
+ <property name="BorderWidth">2</property>
+ <child>
+ <widget class="Gtk.Notebook" id="notebook">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="CurrentPage">0</property>
+ <child>
+ <widget class="MonoDevelop.PackageManagement.PackagesWidget" id="availablePackagesWidget">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="availablePackagesLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Available</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="MonoDevelop.PackageManagement.PackagesWidget" id="installedPackagesWidget">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="installedPackagesLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Installed</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="MonoDevelop.PackageManagement.PackagesWidget" id="UpdatedPackagesWidget">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="updatedPackagesLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Updated</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="MonoDevelop.PackageManagement.PackagesWidget" id="recentPackagesWidget">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ <packing>
+ <property name="Position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="recentPackagesLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Recent</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Expander" id="messagesExpander">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <signal name="Activated" handler="MessagesExpanderActivated" />
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow8">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TextView" id="messagesTextView">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ <property name="Editable">False</property>
+ <property name="CursorVisible">False</property>
+ <property name="Text" translatable="yes" />
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="messagesExpanderLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Messages</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child internal-child="ActionArea">
+ <widget class="Gtk.HButtonBox" id="buttonArea">
+ <property name="MemberName" />
+ <property name="Spacing">10</property>
+ <property name="BorderWidth">5</property>
+ <property name="Size">1</property>
+ <property name="LayoutStyle">End</property>
+ <child>
+ <widget class="Gtk.Button" id="buttonClose">
+ <property name="MemberName" />
+ <property name="CanDefault">True</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-close</property>
+ <property name="ResponseId">-7</property>
+ <property name="label">gtk-close</property>
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Bin" id="MonoDevelop.PackageManagement.PackagesWidget" design-size="641 371">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.HPaned" id="mainPane">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Position">322</property>
+ <child>
+ <widget class="Gtk.VBox" id="packagesListVBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="packagesTreeScrolledWindow">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TreeView" id="packagesTreeView">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ <property name="EnableSearch">False</property>
+ <property name="HeadersVisible">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="pagedResultsHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="pagedResultsLeftLabel">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="MonoDevelop.PackageManagement.PagedResultsWidget" id="pagedResultsWidget">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="pagedResultsRightLabel">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Resize">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="packageInfoVBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.ComboBox" id="packageSourceComboBox">
+ <property name="MemberName" />
+ <property name="IsTextCombo">True</property>
+ <property name="Items" translatable="yes" />
+ <signal name="Changed" handler="PackageSourceChanged" />
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="packageSearchHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Entry" id="packageSearchEntry">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="IsEditable">True</property>
+ <property name="InvisibleChar">●</property>
+ <signal name="Activated" handler="PackageSearchEntryActivated" after="yes" />
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="packageSearchButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextAndIcon</property>
+ <property name="Icon">stock:gtk-find Menu</property>
+ <property name="Label" translatable="yes" />
+ <property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="SearchButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.CheckButton" id="includePrereleaseCheckButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">Include Prerelease</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HButtonBox" id="updateAllPackagesButtonBox">
+ <property name="MemberName" />
+ <property name="Size">1</property>
+ <property name="LayoutStyle">End</property>
+ <child>
+ <widget class="Gtk.Button" id="updateAllPackagesButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">Update All</property>
+ <property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="UpdateAllPackagesButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">3</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Frame" id="packageInfoFrame">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <property name="LabelYalign">0</property>
+ <child>
+ <widget class="Gtk.Alignment" id="packageInfoFrameAlignment">
+ <property name="MemberName" />
+ <property name="Xalign">0</property>
+ <property name="Yalign">0</property>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.Viewport" id="GtkViewport">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.VBox" id="packageInfoFrameVBox">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <property name="ShowScrollbars">True</property>
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HBox" id="packageCreatedByHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="packageCreatedByLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;span weight='bold'&gt;Created by:&lt;/span&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="packageCreatedByTextBox">
+ <property name="MemberName" />
+ <property name="Selectable">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="packageIdHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="packageIdLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;span weight='bold'&gt;Id:&lt;/span&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="MonoDevelop.PackageManagement.HyperlinkWidget" id="packageIdButton">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="packageIdTextBox">
+ <property name="MemberName" />
+ <property name="Selectable">True</property>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="packageVersionHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="packageVersionLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;span weight='bold'&gt;Version:&lt;/span&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="packageVersionTextBox">
+ <property name="MemberName" />
+ <property name="Selectable">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="packageLastUpdatedHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="packageLastUpdatedLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;span weight='bold'&gt;Last Updated:&lt;/span&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="packageLastUpdatedTextBox">
+ <property name="MemberName" />
+ <property name="Selectable">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">3</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="packageDownloadsHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="packageDownloadsLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;span weight='bold'&gt;Downloads:&lt;/span&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="packageDownloadsTextBox">
+ <property name="MemberName" />
+ <property name="Selectable">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">4</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="viewLicenseTermsHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="MonoDevelop.PackageManagement.HyperlinkWidget" id="viewLicenseTermsButton">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ <property name="Uri" />
+ <property name="Label">View License Terms</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">5</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="moreInformationHBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="MonoDevelop.PackageManagement.HyperlinkWidget" id="moreInformationButton">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ <property name="Uri" />
+ <property name="Label">More Information</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">6</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.TextView" id="packageDescriptionTextView">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Editable">False</property>
+ <property name="CursorVisible">False</property>
+ <property name="Text" translatable="yes" />
+ <property name="WrapMode">Word</property>
+ </widget>
+ <packing>
+ <property name="Position">7</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="packageDependenciesHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="packageDependenciesLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;span weight='bold'&gt;Dependencies:&lt;/span&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="packageDependenciesNoneLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">None</property>
+ <property name="Selectable">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">8</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="packageDependenciesListHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <property name="BorderWidth">2</property>
+ <child>
+ <widget class="Gtk.Label" id="packageDependenciesListLabel">
+ <property name="MemberName" />
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="packageDependenciesListFillerLabel">
+ <property name="MemberName" />
+ <property name="Selectable">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">9</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">4</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HButtonBox" id="managePackageButtonBox">
+ <property name="MemberName" />
+ <property name="Size">3</property>
+ <property name="LayoutStyle">Start</property>
+ <child>
+ <widget class="Gtk.Button" id="addPackageButton">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">Add</property>
+ <property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="OnAddPackageButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="removePackageButton">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">Remove</property>
+ <property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="RemovePackageButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="managePackageButton">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">Manage</property>
+ <property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="ManagePackagesButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="PackType">End</property>
+ <property name="Position">5</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Bin" id="MonoDevelop.PackageManagement.HyperlinkWidget" design-size="300 121">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ <widget class="Gtk.Dialog" id="MonoDevelop.PackageManagement.LicenseAcceptanceDialog" design-size="447 300">
+ <property name="MemberName" />
+ <property name="Title" translatable="yes">License Agreements</property>
+ <property name="WindowPosition">Center</property>
+ <property name="Modal">True</property>
+ <property name="Buttons">2</property>
+ <property name="HelpButton">False</property>
+ <child internal-child="VBox">
+ <widget class="Gtk.VBox" id="mainVBox">
+ <property name="MemberName" />
+ <property name="BorderWidth">2</property>
+ <child>
+ <widget class="Gtk.HBox" id="subTitleHBoxForSinglePackage">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="subTitleLabelForSinglePackage">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">The following package requires a click-to-accept license:</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="subTitleHBoxForMultiplePackages">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="subTitleLabelForMultiplePackages">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">The following packages require a click-to-accept license:</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.Viewport" id="GtkViewport">
+ <property name="MemberName" />
+ <property name="ShadowType">None</property>
+ <child>
+ <widget class="Gtk.VBox" id="packagesVBox">
+ <property name="MemberName" />
+ <property name="ShowScrollbars">True</property>
+ <property name="Spacing">6</property>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Padding">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="bottomMessageHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="mainMessageLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">By clicking "OK" you agree to the license terms for the packages listed above.
+If you do not agree to the license terms click "Cancel".</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">3</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child internal-child="ActionArea">
+ <widget class="Gtk.HButtonBox" id="mainButtonArea">
+ <property name="MemberName" />
+ <property name="Spacing">10</property>
+ <property name="BorderWidth">5</property>
+ <property name="Size">2</property>
+ <property name="LayoutStyle">End</property>
+ <child>
+ <widget class="Gtk.Button" id="buttonCancel">
+ <property name="MemberName" />
+ <property name="CanDefault">True</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-cancel</property>
+ <property name="ResponseId">-6</property>
+ <property name="label">gtk-cancel</property>
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonOk">
+ <property name="MemberName" />
+ <property name="CanDefault">True</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-ok</property>
+ <property name="ResponseId">-5</property>
+ <property name="label">gtk-ok</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Bin" id="MonoDevelop.PackageManagement.PackageLicenseWidget" design-size="461 77">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.HBox" id="mainHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.VBox" id="packageIdVBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HBox" id="packageIdHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="packageIdLabel">
+ <property name="MemberName" />
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="MonoDevelop.PackageManagement.HyperlinkWidget" id="licenseHyperlinkWidget">
+ <property name="MemberName" />
+ <property name="Events">ButtonPressMask</property>
+ <property name="Label">View License Terms</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="fillerLabel">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TextView" id="packageSummaryTextView">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ <property name="Editable">False</property>
+ <property name="CursorVisible">False</property>
+ <property name="Text" translatable="yes" />
+ <property name="WrapMode">Word</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Dialog" id="MonoDevelop.PackageManagement.SelectProjectsDialog" design-size="400 300">
+ <property name="MemberName" />
+ <property name="Title" translatable="yes">Select Projects</property>
+ <property name="WindowPosition">Center</property>
+ <property name="Buttons">2</property>
+ <property name="HelpButton">False</property>
+ <child internal-child="VBox">
+ <widget class="Gtk.VBox" id="mainVBox">
+ <property name="MemberName" />
+ <property name="BorderWidth">2</property>
+ <child>
+ <widget class="Gtk.HBox" id="installLabelHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="installLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Install the package into the following projects:</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder />
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TreeView" id="projectsTreeView">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ <property name="HeadersVisible">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child internal-child="ActionArea">
+ <widget class="Gtk.HButtonBox" id="buttonActionArea">
+ <property name="MemberName" />
+ <property name="Spacing">10</property>
+ <property name="BorderWidth">5</property>
+ <property name="Size">2</property>
+ <property name="LayoutStyle">End</property>
+ <child>
+ <widget class="Gtk.Button" id="buttonCancel">
+ <property name="MemberName" />
+ <property name="CanDefault">True</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-cancel</property>
+ <property name="ResponseId">-6</property>
+ <property name="label">gtk-cancel</property>
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonOk">
+ <property name="MemberName" />
+ <property name="CanDefault">True</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-ok</property>
+ <property name="ResponseId">-5</property>
+ <property name="label">gtk-ok</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Bin" id="MonoDevelop.PackageManagement.PackageSourcesWidget" design-size="452 300">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.VBox" id="mainVBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HBox" id="packageSourceListHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TreeView" id="packageSourcesTreeView">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ <property name="HeadersVisible">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VButtonBox" id="moveButtonsBox">
+ <property name="MemberName" />
+ <property name="Size">3</property>
+ <property name="LayoutStyle">Start</property>
+ <child>
+ <widget class="Gtk.Button" id="moveUpButton">
+ <property name="MemberName" />
+ <property name="Sensitive">False</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-go-up</property>
+ <signal name="Clicked" handler="MoveUpButtonClicked" />
+ <property name="label">gtk-go-up</property>
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="moveDownButton">
+ <property name="MemberName" />
+ <property name="Sensitive">False</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-go-down</property>
+ <signal name="Clicked" handler="MoveDownButtonClicked" />
+ <property name="label">gtk-go-down</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="removeButton">
+ <property name="MemberName" />
+ <property name="Sensitive">False</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-remove</property>
+ <signal name="Clicked" handler="RemoveButtonClicked" />
+ <property name="label">gtk-remove</property>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="packageSourceHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.VBox" id="packageSourceLabelsHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="packageSourceNameLabel">
+ <property name="MemberName" />
+ <property name="Ypad">4</property>
+ <property name="LabelProp" translatable="yes">Name:</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="packageSourceLabel">
+ <property name="MemberName" />
+ <property name="Ypad">4</property>
+ <property name="LabelProp" translatable="yes">Source:</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="packageSourceTextBoxesVBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Entry" id="packageSourceNameTextBox">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="IsEditable">True</property>
+ <property name="InvisibleChar">●</property>
+ <signal name="Changed" handler="PackageSourceNameTextBoxChanged" />
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Entry" id="packageSourceTextBox">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="IsEditable">True</property>
+ <property name="InvisibleChar">●</property>
+ <signal name="Changed" handler="PackageSourceTextBoxChanged" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VButtonBox" id="packageSourceButtonsBox">
+ <property name="MemberName" />
+ <property name="Size">2</property>
+ <property name="LayoutStyle">Start</property>
+ <child>
+ <widget class="Gtk.Button" id="addButton">
+ <property name="MemberName" />
+ <property name="Sensitive">False</property>
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-add</property>
+ <signal name="Clicked" handler="AddButtonClicked" />
+ <property name="label">gtk-add</property>
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="browseButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">_Browse...</property>
+ <property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="BrowseButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Bin" id="MonoDevelop.PackageManagement.PackageManagementOptionsWidget" design-size="355 307">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.VBox" id="mainVBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HBox" id="recentPackagesLabelHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="recentPackagesFrameLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;b&gt;Recent Packages&lt;/b&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="recentPackagesPaddingLabel">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HButtonBox" id="recentPackagesButtonBox">
+ <property name="MemberName" />
+ <property name="BorderWidth">8</property>
+ <property name="Size">1</property>
+ <property name="LayoutStyle">Start</property>
+ <child>
+ <widget class="Gtk.Button" id="clearRecentPackagesButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">Clear _Recent Packages</property>
+ <property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="ClearRecentPackagesButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="packagesCacheLabelHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="packagesCacheLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;b&gt;Packages Cache&lt;/b&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="packagesCachePaddingLabel">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="packagesCacheHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.HButtonBox" id="packagesCacheButtonBox">
+ <property name="MemberName" />
+ <property name="BorderWidth">8</property>
+ <property name="Size">1</property>
+ <property name="LayoutStyle">Start</property>
+ <child>
+ <widget class="Gtk.Button" id="clearPackagesCacheButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">Clear Package _Cache</property>
+ <property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="ClearPackagesCacheButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ <property name="Expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="browseButtonHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Button" id="browseButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">_Browse...</property>
+ <property name="UseUnderline">True</property>
+ <property name="BorderWidth">8</property>
+ <signal name="Clicked" handler="BrowseButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">3</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.HBox" id="restorePackagesLabelHBox">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Label" id="restorePackagesLabel">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">&lt;b&gt;Restore Packages&lt;/b&gt;</property>
+ <property name="UseMarkup">True</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="restorePackagesPaddingLabel">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">4</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.CheckButton" id="restorePackagesCheckBox">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">_Enable package restore</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ <property name="BorderWidth">10</property>
+ <signal name="Toggled" handler="RestorePackagesCheckBoxToggled" />
+ </widget>
+ <packing>
+ <property name="Position">5</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="bottomLabel">
+ <property name="MemberName" />
+ </widget>
+ <packing>
+ <property name="Position">6</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <widget class="Gtk.Bin" id="MonoDevelop.PackageManagement.PagedResultsWidget" design-size="181 30">
+ <property name="MemberName" />
+ <property name="Visible">False</property>
+ <child>
+ <widget class="Gtk.HBox" id="mainHBox">
+ <property name="MemberName" />
+ <child>
+ <widget class="Gtk.Button" id="backButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextAndIcon</property>
+ <property name="Icon">stock:gtk-go-back Menu</property>
+ <property name="Label" translatable="yes" />
+ <property name="FocusOnClick">False</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="BackButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="firstButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">1</property>
+ <property name="UseUnderline">True</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="PageButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="secondButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">2</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="PageButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="thirdButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">3</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="PageButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">3</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="fourthButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">4</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="PageButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">4</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="fifthButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">5</property>
+ <property name="FocusOnClick">False</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="PageButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">5</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="forwardButton">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextAndIcon</property>
+ <property name="Icon">stock:gtk-go-forward Menu</property>
+ <property name="Label" translatable="yes" />
+ <property name="FocusOnClick">False</property>
+ <property name="Relief">None</property>
+ <signal name="Clicked" handler="ForwardButtonClicked" />
+ </widget>
+ <packing>
+ <property name="Position">6</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</stetic-interface> \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/icons/packageicon.png b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/icons/packageicon.png
new file mode 100644
index 0000000000..ef5435eb03
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/icons/packageicon.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/lib/Microsoft.Web.XmlTransform.dll b/main/src/addins/MonoDevelop.PackageManagement/lib/Microsoft.Web.XmlTransform.dll
new file mode 100644
index 0000000000..e8f5894a8b
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/lib/Microsoft.Web.XmlTransform.dll
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet-COPYRIGHT.txt b/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet-COPYRIGHT.txt
new file mode 100644
index 0000000000..3df73cc9ba
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet-COPYRIGHT.txt
@@ -0,0 +1,13 @@
+ Copyright 2010-2012 Outercurve Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet-LICENSE.txt b/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet-LICENSE.txt
new file mode 100644
index 0000000000..63c0dc1766
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet-LICENSE.txt
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
diff --git a/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet.Core.dll b/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet.Core.dll
new file mode 100644
index 0000000000..e424b39706
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet.Core.dll
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet.exe b/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet.exe
new file mode 100644
index 0000000000..b72cce110c
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/lib/NuGet.exe
Binary files differ
diff --git a/main/src/addins/MonoDevelop.PackageManagement/lib/nunit.framework.dll b/main/src/addins/MonoDevelop.PackageManagement/lib/nunit.framework.dll
new file mode 100644
index 0000000000..3e24ba1ca6
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/lib/nunit.framework.dll
Binary files differ