├── .gitattributes ├── .gitignore ├── AUTHORS.txt ├── LICENSE.txt ├── README.md ├── ReleaseNotes.txt ├── addin-project.xml ├── contributing.md ├── lib ├── ICSharpCode.NRefactory.dll ├── Microsoft.Web.XmlTransform.dll ├── MonoDevelop.Core.dll ├── MonoDevelop.Ide.dll ├── NuGet-COPYRIGHT.txt ├── NuGet-LICENSE.txt ├── NuGet.Core.dll ├── NuGet.exe └── nunit.framework.dll ├── src ├── MonoDevelop.PackageManagement.Tests │ ├── MSBuildProjectExtensionsTests.cs │ ├── MonoDevelop.PackageManagement.Tests.csproj │ └── Properties │ │ └── AssemblyInfo.cs ├── MonoDevelop.PackageManagement.sln └── MonoDevelop.PackageManagement │ ├── AssemblyInfo.cs │ ├── MonoDevelop.PackageManagement.Commands │ ├── ManagePackagesHandler.cs │ ├── PackagesCommandHandler.cs │ └── RestorePackagesHandler.cs │ ├── MonoDevelop.PackageManagement.Gui │ ├── HyperlinkWidget.cs │ ├── LicenseAcceptanceDialog.cs │ ├── ManagePackagesDialog.cs │ ├── PackageLicenseWidget.cs │ ├── PackageManagementOptionsPanel.cs │ ├── PackageManagementOptionsWidget.cs │ ├── PackageSourcesOptionsPanel.cs │ ├── PackageSourcesWidget.cs │ ├── PackagesWidget.cs │ ├── PagedResultsWidget.cs │ └── SelectProjectsDialog.cs │ ├── MonoDevelop.PackageManagement.addin.xml │ ├── MonoDevelop.PackageManagement.csproj │ ├── MonoDevelop.PackageManagement │ ├── AcceptLicensesEventArgs.cs │ ├── AggregateExceptionErrorMessage.cs │ ├── AvailablePackagesViewModel.cs │ ├── ConfigSettingsFileSystem.cs │ ├── DefaultProjectTemplatePackageSource.cs │ ├── DelegateCommand.cs │ ├── DotNetProjectExtensions.cs │ ├── FileConflictResolver.cs │ ├── FolderBrowser.cs │ ├── ICommand.cs │ ├── ICompilerMessageView.cs │ ├── IFolderBrowser.cs │ ├── ILicenseAcceptanceService.cs │ ├── IMachinePackageCache.cs │ ├── IMessageViewCategory.cs │ ├── IPackageAction.cs │ ├── IPackageActionRunner.cs │ ├── IPackageExtensions.cs │ ├── IPackageFromRepository.cs │ ├── IPackageFromRepositoryExtensions.cs │ ├── IPackageManagementEvents.cs │ ├── IPackageManagementFileService.cs │ ├── IPackageManagementOutputMessagesView.cs │ ├── IPackageManagementProject.cs │ ├── IPackageManagementProjectFactory.cs │ ├── IPackageManagementProjectService.cs │ ├── IPackageManagementSelectedProject.cs │ ├── IPackageManagementSolution.cs │ ├── IPackageManagerFactory.cs │ ├── IPackageOperationResolverFactory.cs │ ├── IPackageRepositoryCache.cs │ ├── IPackageRepositoryExtensions.cs │ ├── IPackageRepositoryFactoryEvents.cs │ ├── IPackageViewModelFactory.cs │ ├── IPackageViewModelParent.cs │ ├── IProcess.cs │ ├── IProjectBrowserUpdater.cs │ ├── IPropertyService.cs │ ├── IRecentPackageRepository.cs │ ├── IRegisteredPackageRepositories.cs │ ├── ISelectProjectsService.cs │ ├── ISettingsFactory.cs │ ├── ISharpDevelopPackageManager.cs │ ├── ISharpDevelopPackageRepositoryFactory.cs │ ├── ISharpDevelopProjectManager.cs │ ├── ISharpDevelopProjectSystemFactory.cs │ ├── ISolutionPackageRepository.cs │ ├── ISolutionPackageRepositoryFactory.cs │ ├── ITask.cs │ ├── ITaskFactory.cs │ ├── IThreadSafePackageManagementEvents.cs │ ├── IUpdatePackageActions.cs │ ├── IUpdatePackageSettings.cs │ ├── IUpdatePackagesAction.cs │ ├── InstallPackageAction.cs │ ├── InstalledPackageViewModel.cs │ ├── InstalledPackageViewModelFactory.cs │ ├── InstalledPackagesViewModel.cs │ ├── LicenseAcceptanceService.cs │ ├── LicenseAcceptanceViewModel.cs │ ├── MSBuildProjectExtensions.cs │ ├── MachinePackageCache.cs │ ├── ManagePackagesUserPrompts.cs │ ├── ManagePackagesViewModel.cs │ ├── ManagePackagesViewTitle.cs │ ├── MarkupString.cs │ ├── MonoDevelopCredentialProvider.cs │ ├── MonoDevelopHttpUserAgent.cs │ ├── NuGetExePath.cs │ ├── NuGetPackageRestoreCommandLine.cs │ ├── OpenDotNetProjects.cs │ ├── PackageActionRunner.cs │ ├── PackageFiles.cs │ ├── PackageFilesForOperations.cs │ ├── PackageFromRepository.cs │ ├── PackageLicenseViewModel.cs │ ├── PackageManagementCompilerMessageView.cs │ ├── PackageManagementEnumerableExtensions.cs │ ├── PackageManagementEvents.cs │ ├── PackageManagementFileService.cs │ ├── PackageManagementLogger.cs │ ├── PackageManagementMessageViewCategory.cs │ ├── PackageManagementOptions.cs │ ├── PackageManagementOptionsViewModel.cs │ ├── PackageManagementOutputMessagesView.cs │ ├── PackageManagementProject.cs │ ├── PackageManagementProjectFactory.cs │ ├── PackageManagementProjectService.cs │ ├── PackageManagementPropertyService.cs │ ├── PackageManagementSelectedProject.cs │ ├── PackageManagementSelectedProjects.cs │ ├── PackageManagementServices.cs │ ├── PackageManagementSolution.cs │ ├── PackageManagementTask.cs │ ├── PackageManagementTaskFactory.cs │ ├── PackageManagementViewModels.cs │ ├── PackageOperationExceptionEventArgs.cs │ ├── PackageOperationMessage.cs │ ├── PackageOperationMessageLoggedEventArgs.cs │ ├── PackageOperationsResolverFactory.cs │ ├── PackageRepositoryCache.cs │ ├── PackageRepositoryFactoryEventArgs.cs │ ├── PackageSourceConverter.cs │ ├── PackageSourceExtensions.cs │ ├── PackageSourceViewModel.cs │ ├── PackageViewModel.cs │ ├── PackageViewModelFactory.cs │ ├── PackageViewModelOperationLogger.cs │ ├── PackagesForSelectedPageResult.cs │ ├── PackagesViewModel.cs │ ├── PackagesViewModels.cs │ ├── Page.cs │ ├── Pages.cs │ ├── ParentPackageOperationEventArgs.cs │ ├── ParentPackagesOperationEventArgs.cs │ ├── Process.cs │ ├── ProcessPackageAction.cs │ ├── ProcessPackageOperationsAction.cs │ ├── ProjectBrowserUpdater.cs │ ├── ProjectExtensions.cs │ ├── ProjectTargetFramework.cs │ ├── ProjectTemplatePackageRepositoryCache.cs │ ├── ProjectTemplatePackageSettingsFileName.cs │ ├── RecentPackageInfo.cs │ ├── RecentPackageRepository.cs │ ├── RecentPackagesViewModel.cs │ ├── ReducedPackageOperations.cs │ ├── RegisteredPackageRepositories.cs │ ├── RegisteredPackageSource.cs │ ├── RegisteredPackageSourceSettings.cs │ ├── RegisteredPackageSources.cs │ ├── RegisteredPackageSourcesViewModel.cs │ ├── RegisteredProjectTemplatePackageSources.cs │ ├── RemovedPackageReferenceMonitor.cs │ ├── ResolveFileConflictEventArgs.cs │ ├── SelectProjectsEventArgs.cs │ ├── SelectProjectsService.cs │ ├── SelectProjectsViewModel.cs │ ├── SelectedProjectsForInstalledPackages.cs │ ├── SelectedProjectsForUpdatedPackages.cs │ ├── SettingsFactory.cs │ ├── SharpDevelopPackageManager.cs │ ├── SharpDevelopPackageManagerFactory.cs │ ├── SharpDevelopPackageRepositoryFactory.cs │ ├── SharpDevelopProjectManager.cs │ ├── SharpDevelopProjectSystem.cs │ ├── SharpDevelopProjectSystemFactory.cs │ ├── SolutionExtensions.cs │ ├── SolutionPackageRepository.cs │ ├── SolutionPackageRepositoryFactory.cs │ ├── SolutionPackageRepositoryPath.cs │ ├── ThreadSafePackageManagementEvents.cs │ ├── ThreadSafeProjectBrowserUpdater.cs │ ├── UninstallPackageAction.cs │ ├── UpdatePackageAction.cs │ ├── UpdatePackagesAction.cs │ ├── UpdatePackagesActionFactory.cs │ ├── UpdateSolutionPackagesAction.cs │ ├── UpdatedPackageViewModel.cs │ ├── UpdatedPackageViewModelFactory.cs │ ├── UpdatedPackages.cs │ ├── UpdatedPackagesViewModel.cs │ ├── UserAgentGeneratorForRepositoryRequests.cs │ └── ViewModelBase.cs │ ├── PostBuildEvent.proj │ ├── gtk-gui │ ├── MonoDevelop.PackageManagement.HyperlinkWidget.cs │ ├── MonoDevelop.PackageManagement.LicenseAcceptanceDialog.cs │ ├── MonoDevelop.PackageManagement.ManagePackagesDialog.cs │ ├── MonoDevelop.PackageManagement.PackageLicenseWidget.cs │ ├── MonoDevelop.PackageManagement.PackageManagementOptionsWidget.cs │ ├── MonoDevelop.PackageManagement.PackageSourcesWidget.cs │ ├── MonoDevelop.PackageManagement.PackagesWidget.cs │ ├── MonoDevelop.PackageManagement.PagedResultsWidget.cs │ ├── MonoDevelop.PackageManagement.SelectProjectsDialog.cs │ ├── generated.cs │ └── gui.stetic │ └── icons │ └── packageicon.png └── testing.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # NOTE: this file is for git 1.6.6 (and possibly older) 2 | # Post-1.7.2 there is eol and text, and crlf is deprecated 3 | # but we can't depend on an unreleased version... 4 | 5 | # This file mainly controls line ending conversion behaviour, if 6 | # the user has the setting core.autocrlf true. 7 | 8 | # The meaning of the attributes is a little odd 9 | # -crlf means DO NOT convert line endings 10 | # crlf means CONVERT to lf in the repo & Linux/Mac, crlf on Windows 11 | 12 | # First, turn off git line ending handling except on a case-by-case basis 13 | # because our repo isn't normalized, in general. 14 | # There are even files with mixed line endings. 15 | * -crlf 16 | 17 | # sln is always CRLF, even on linux, so don't convert 18 | *.sln -crlf 19 | 20 | # These files can be converted, since they're new 21 | .gitattributes crlf 22 | .gitignore crlf 23 | 24 | # Having proj files as crlf on windows will make VS happier 25 | # MD can deal with (and preserve) either, so it doesn't matter. 26 | # Unfortunately MD creates with LF, so we need to convert these. 27 | *proj crlf 28 | 29 | # All Stetic's files are always generated as LF, so explicitly ignore those. 30 | # Sadly, git has useless path globs 31 | */*/gtk-gui/* -crlf 32 | */*/*/gtk-gui/* -crlf 33 | */*/*/*/gtk-gui/* -crlf 34 | */*/*/*/*/gtk-gui/* -crlf 35 | */*/*/*/*/*/gtk-gui/* -crlf 36 | */*/*/*/*/*/*/gtk-gui/* -crlf 37 | */*/*/*/*/*/*/*/gtk-gui/* -crlf 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | obj 2 | bin -------------------------------------------------------------------------------- /AUTHORS.txt: -------------------------------------------------------------------------------- 1 | Matt Ward 2 | 3 | Matthew Kowalski 4 | Fixed building the project on Mac. 5 | Updated addin.xml file with correct GitHub url for project. 6 | 7 | Geoffrey Huntley 8 | Updated documentation with installation instructions. 9 | 10 | Francisco Ruiz A 11 | Updated addin.xml file to work with Xamarin Studio. 12 | 13 | Kevin John-Philip 14 | Supported using package restore with different parallel mono environments. -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Matthew Ward 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. -------------------------------------------------------------------------------- /addin-project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | bin/MonoDevelop.PackageManagement.dll 4 | src/MonoDevelop.PackageManagement.sln 5 | Debug 6 | 7 | -------------------------------------------------------------------------------- /contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for taking the time to contribute to this project. 4 | 5 | Changes to the MonoDevelop and Xamarin Studio specific parts of the project can be made directly to this repository. Changes to the core parts of the addin, which is anything in the ICSharpCode.PackageManagement namespace, should be contributed to the SharpDevelop repository and should contain unit tests. 6 | 7 | # License 8 | 9 | The MonoDevelop NuGet addin is MIT licensed. By contributing to the project you agree to license your contributions by the same license. -------------------------------------------------------------------------------- /lib/ICSharpCode.NRefactory.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrward/monodevelop-nuget-addin/08b2d57263f1b991253fe9001b97384d56d9d5f7/lib/ICSharpCode.NRefactory.dll -------------------------------------------------------------------------------- /lib/Microsoft.Web.XmlTransform.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrward/monodevelop-nuget-addin/08b2d57263f1b991253fe9001b97384d56d9d5f7/lib/Microsoft.Web.XmlTransform.dll -------------------------------------------------------------------------------- /lib/MonoDevelop.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrward/monodevelop-nuget-addin/08b2d57263f1b991253fe9001b97384d56d9d5f7/lib/MonoDevelop.Core.dll -------------------------------------------------------------------------------- /lib/MonoDevelop.Ide.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrward/monodevelop-nuget-addin/08b2d57263f1b991253fe9001b97384d56d9d5f7/lib/MonoDevelop.Ide.dll -------------------------------------------------------------------------------- /lib/NuGet-COPYRIGHT.txt: -------------------------------------------------------------------------------- 1 | Copyright 2010-2012 Outercurve Foundation 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /lib/NuGet.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrward/monodevelop-nuget-addin/08b2d57263f1b991253fe9001b97384d56d9d5f7/lib/NuGet.Core.dll -------------------------------------------------------------------------------- /lib/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrward/monodevelop-nuget-addin/08b2d57263f1b991253fe9001b97384d56d9d5f7/lib/NuGet.exe -------------------------------------------------------------------------------- /lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrward/monodevelop-nuget-addin/08b2d57263f1b991253fe9001b97384d56d9d5f7/lib/nunit.framework.dll -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("MonoDevelop.PackageManagement.Tests")] 13 | [assembly: AssemblyDescription("NuGet addin for MonoDevelop Tests")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("MonoDevelop.PackageManagement.Tests")] 17 | [assembly: AssemblyCopyright("Copyright (C) 2012-2013 Matthew Ward")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | // This sets the default COM visibility of types in the assembly to invisible. 21 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | // The assembly version has following format : 25 | // 26 | // Major.Minor.Build.Revision 27 | // 28 | // You can specify all the values or you can use the default the Revision and 29 | // Build Numbers by using the '*' as shown below: 30 | [assembly: AssemblyVersion("1.0")] 31 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | # SharpDevelop 4.3 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.PackageManagement", "MonoDevelop.PackageManagement\MonoDevelop.PackageManagement.csproj", "{F218643D-2E74-4309-820E-206A54B7133F}" 6 | EndProject 7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.PackageManagement.Tests", "MonoDevelop.PackageManagement.Tests\MonoDevelop.PackageManagement.Tests.csproj", "{2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}" 8 | EndProject 9 | Global 10 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 11 | Debug|Any CPU = Debug|Any CPU 12 | Release|Any CPU = Release|Any CPU 13 | EndGlobalSection 14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 15 | {F218643D-2E74-4309-820E-206A54B7133F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {F218643D-2E74-4309-820E-206A54B7133F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {F218643D-2E74-4309-820E-206A54B7133F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | {F218643D-2E74-4309-820E-206A54B7133F}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {2645C9F3-9ED5-4806-AB09-DAD9BE90C67B}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | EndGlobalSection 24 | EndGlobal 25 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | 3 | using System; 4 | using System.Reflection; 5 | using System.Runtime.InteropServices; 6 | 7 | #endregion 8 | 9 | // General Information about an assembly is controlled through the following 10 | // set of attributes. Change these attribute values to modify the information 11 | // associated with an assembly. 12 | [assembly: AssemblyTitle("MonoDevelop.PackageManagement")] 13 | [assembly: AssemblyDescription("NuGet addin for MonoDevelop")] 14 | [assembly: AssemblyConfiguration("")] 15 | [assembly: AssemblyCompany("")] 16 | [assembly: AssemblyProduct("MonoDevelop.PackageManagement")] 17 | [assembly: AssemblyCopyright("Copyright (C) 2012-2013 Matthew Ward")] 18 | [assembly: AssemblyTrademark("")] 19 | [assembly: AssemblyCulture("")] 20 | 21 | // This sets the default COM visibility of types in the assembly to invisible. 22 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 23 | [assembly: ComVisible(false)] 24 | 25 | // The assembly version has following format : 26 | // 27 | // Major.Minor.Build.Revision 28 | // 29 | // You can specify all the values or you can use the default the Revision and 30 | // Build Numbers by using the '*' as shown below: 31 | [assembly: AssemblyVersion("0.9")] 32 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/ManagePackagesHandler.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ManagePackagesHandler.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using ICSharpCode.PackageManagement; 31 | using MonoDevelop.Ide; 32 | 33 | namespace MonoDevelop.PackageManagement.Commands 34 | { 35 | public class ManagePackagesHandler : PackagesCommandHandler 36 | { 37 | protected override void Run () 38 | { 39 | try { 40 | var viewModels = new PackageManagementViewModels (); 41 | IPackageManagementEvents packageEvents = PackageManagementServices.PackageManagementEvents; 42 | var dialog = new ManagePackagesDialog (viewModels.ManagePackagesViewModel, packageEvents); 43 | MessageService.ShowCustomDialog (dialog); 44 | } catch (Exception ex) { 45 | MessageService.ShowException (ex); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackagesCommandHandler.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackagesCommandHandler.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Components.Commands; 31 | using MonoDevelop.Ide; 32 | using MonoDevelop.Projects; 33 | 34 | namespace MonoDevelop.PackageManagement.Commands 35 | { 36 | public abstract class PackagesCommandHandler : CommandHandler 37 | { 38 | protected override void Update (CommandInfo info) 39 | { 40 | if (IsDotNetProjectSelected () || IsDotNetSolutionSelected()) { 41 | info.Bypass = false; 42 | } else { 43 | info.Enabled = false; 44 | info.Bypass = true; 45 | } 46 | } 47 | 48 | bool IsDotNetProjectSelected () 49 | { 50 | return IdeApp.ProjectOperations.CurrentSelectedProject is DotNetProject; 51 | } 52 | 53 | bool IsDotNetSolutionSelected () 54 | { 55 | return IdeApp.ProjectOperations.CurrentSelectedSolution != null; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/LicenseAcceptanceDialog.cs: -------------------------------------------------------------------------------- 1 | // 2 | // LicenseAcceptanceDialog.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using ICSharpCode.PackageManagement; 31 | using NuGet; 32 | 33 | namespace MonoDevelop.PackageManagement 34 | { 35 | public partial class LicenseAcceptanceDialog : Gtk.Dialog 36 | { 37 | LicenseAcceptanceViewModel viewModel; 38 | 39 | public LicenseAcceptanceDialog (LicenseAcceptanceViewModel viewModel) 40 | { 41 | this.Build (); 42 | this.viewModel = viewModel; 43 | this.subTitleHBoxForSinglePackage.Visible = viewModel.HasOnePackage; 44 | this.subTitleHBoxForMultiplePackages.Visible = viewModel.HasMultiplePackages; 45 | AddPackages (); 46 | } 47 | 48 | void AddPackages () 49 | { 50 | foreach (PackageLicenseViewModel package in viewModel.Packages) { 51 | AddPackageWidget (package); 52 | } 53 | this.packagesVBox.ShowAll (); 54 | } 55 | 56 | void AddPackageWidget (PackageLicenseViewModel package) 57 | { 58 | var widget = new PackageLicenseWidget (package); 59 | this.packagesVBox.Add (widget); 60 | } 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageLicenseWidget.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageLicenseWidget.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using ICSharpCode.PackageManagement; 31 | using NuGet; 32 | 33 | namespace MonoDevelop.PackageManagement 34 | { 35 | [System.ComponentModel.ToolboxItem(true)] 36 | public partial class PackageLicenseWidget : Gtk.Bin 37 | { 38 | public PackageLicenseWidget (PackageLicenseViewModel viewModel) 39 | { 40 | this.Build (); 41 | this.DisplayPackage (viewModel); 42 | } 43 | 44 | void DisplayPackage (PackageLicenseViewModel viewModel) 45 | { 46 | this.packageIdLabel.Markup = GetPackageIdMarkup (viewModel.Id); 47 | this.packageSummaryTextView.Buffer.Text = viewModel.Summary; 48 | this.licenseHyperlinkWidget.Uri = viewModel.LicenseUrl.ToString (); 49 | } 50 | 51 | string GetPackageIdMarkup (string id) 52 | { 53 | string format = "{0}"; 54 | return MarkupString.Format (format, id); 55 | } 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageManagementOptionsPanel.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageManagementOptionsPanel.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using ICSharpCode.PackageManagement; 31 | using MonoDevelop.Ide.Gui.Dialogs; 32 | 33 | namespace MonoDevelop.PackageManagement.Gui 34 | { 35 | public class PackageManagementOptionsPanel : OptionsPanel 36 | { 37 | PackageManagementOptionsViewModel optionsViewModel; 38 | 39 | public override Gtk.Widget CreatePanelWidget() 40 | { 41 | var viewModels = new PackageManagementViewModels (); 42 | optionsViewModel = viewModels.PackageManagementOptionsViewModel; 43 | return new PackageManagementOptionsWidget (optionsViewModel); 44 | } 45 | 46 | public override void ApplyChanges() 47 | { 48 | optionsViewModel.SaveOptions (); 49 | } 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/PackageSourcesOptionsPanel.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageSourcesOptionPanel.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using ICSharpCode.PackageManagement; 31 | using MonoDevelop.Ide.Gui.Dialogs; 32 | 33 | namespace MonoDevelop.PackageManagement.Gui 34 | { 35 | public class PackageSourcesOptionsPanel : OptionsPanel 36 | { 37 | PackageManagementViewModels viewModels; 38 | 39 | public override Gtk.Widget CreatePanelWidget() 40 | { 41 | viewModels = new PackageManagementViewModels (); 42 | viewModels.RegisteredPackageSourcesViewModel.Load (); 43 | 44 | return new PackageSourcesWidget (viewModels.RegisteredPackageSourcesViewModel); 45 | } 46 | 47 | public override void ApplyChanges() 48 | { 49 | viewModels.RegisteredPackageSourcesViewModel.Save (); 50 | } 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/AcceptLicensesEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // AcceptLicensesEventArgs.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class AcceptLicensesEventArgs : EventArgs 36 | { 37 | public AcceptLicensesEventArgs(IEnumerable packages) 38 | { 39 | this.Packages = packages; 40 | } 41 | 42 | public IEnumerable Packages { get; private set; } 43 | public bool IsAccepted { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ConfigSettingsFileSystem.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ConfigSettingsFileSystem.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.IO; 31 | using MonoDevelop.Projects; 32 | using NuGet; 33 | 34 | namespace ICSharpCode.PackageManagement 35 | { 36 | public class ConfigSettingsFileSystem : PhysicalFileSystem 37 | { 38 | ConfigSettingsFileSystem(string root) 39 | : base(root) 40 | { 41 | } 42 | 43 | public static ConfigSettingsFileSystem CreateConfigSettingsFileSystem(Solution solution) 44 | { 45 | string configSettingsFolder = Path.Combine(solution.BaseDirectory, ".nuget"); 46 | return new ConfigSettingsFileSystem(configSettingsFolder); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DefaultProjectTemplatePackageSource.cs: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultProjectTemplatePackageSource.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | using System; 29 | using System.IO; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class DefaultProjectTemplatePackageSource 35 | { 36 | PackageSource packageSource; 37 | 38 | public DefaultProjectTemplatePackageSource() 39 | : this(new PackageManagementPropertyService()) 40 | { 41 | } 42 | 43 | public DefaultProjectTemplatePackageSource(IPropertyService propertyService) 44 | { 45 | CreatePackageSource(propertyService.DataDirectory); 46 | } 47 | 48 | void CreatePackageSource(string dataDirectory) 49 | { 50 | string packageDirectory = Path.Combine(dataDirectory, @"templates\packages"); 51 | packageSource = new PackageSource(packageDirectory, "Default"); 52 | } 53 | 54 | public PackageSource PackageSource { 55 | get { return packageSource; } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/DelegateCommand.cs: -------------------------------------------------------------------------------- 1 | // 2 | // DelegateCommand.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public class DelegateCommand : ICommand 34 | { 35 | Action execute; 36 | Predicate canExecute; 37 | 38 | public DelegateCommand(Action execute, Predicate canExecute) 39 | { 40 | this.execute = execute; 41 | this.canExecute = canExecute; 42 | } 43 | 44 | public DelegateCommand(Action execute) 45 | : this(execute, null) 46 | { 47 | } 48 | 49 | public event EventHandler CanExecuteChanged { 50 | add { } //CommandManager.RequerySuggested += value; } 51 | remove { } //CommandManager.RequerySuggested -= value; } 52 | } 53 | 54 | public void Execute(object parameter) 55 | { 56 | execute(parameter); 57 | } 58 | 59 | public bool CanExecute(object parameter) 60 | { 61 | if (canExecute != null) { 62 | return canExecute(parameter); 63 | } 64 | return true; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/FolderBrowser.cs: -------------------------------------------------------------------------------- 1 | // 2 | // FolderBrowser.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Components; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class FolderBrowser : IFolderBrowser 35 | { 36 | public string SelectFolder () 37 | { 38 | var dialog = new SelectFolderDialog (); 39 | if (dialog.Run ()) { 40 | return dialog.SelectedFile; 41 | } 42 | return null; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICommand.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ICommand.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface ICommand 34 | { 35 | bool CanExecute(object parameter); 36 | void Execute(object parameter); 37 | 38 | event EventHandler CanExecuteChanged; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ICompilerMessageView.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ICompilerMessageView.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface ICompilerMessageView 34 | { 35 | IMessageViewCategory Create(string categoryName, string categoryDisplayName); 36 | 37 | IMessageViewCategory GetExisting(string name); 38 | } 39 | } -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IFolderBrowser.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IFolderBrowser.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IFolderBrowser 34 | { 35 | string SelectFolder(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ILicenseAcceptanceService.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ILicenseAcceptanceService.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public interface ILicenseAcceptanceService 36 | { 37 | bool AcceptLicenses(IEnumerable packages); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMachinePackageCache.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IMachinePackageCache.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Linq; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public interface IMachinePackageCache 36 | { 37 | IQueryable GetPackages(); 38 | void Clear(); 39 | string Source { get; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IMessageViewCategory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IMessageViewCategory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IMessageViewCategory 34 | { 35 | void AppendLine(string text); 36 | void Clear(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageAction.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageAction.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IPackageAction 34 | { 35 | void Execute(); 36 | bool HasPackageScriptsToRun(); 37 | //IPackageScriptRunner PackageScriptRunner { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageActionRunner.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageActionRunner.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface IPackageActionRunner 35 | { 36 | void Run(IPackageAction action); 37 | void Run(IEnumerable actions); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageExtensions.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public static class IPackageExtensions 35 | { 36 | /// 37 | /// Returns description if summary is missing. 38 | /// 39 | public static string SummaryOrDescription(this IPackage package) 40 | { 41 | if (String.IsNullOrEmpty(package.Summary)) 42 | return package.Description; 43 | return package.Summary; 44 | } 45 | 46 | /// 47 | /// Returns package Id if it has no title. 48 | /// 49 | public static string GetName(this IPackage package) 50 | { 51 | if (String.IsNullOrEmpty(package.Title)) 52 | return package.Id; 53 | return package.Title; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepository.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageFromRepository.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface IPackageFromRepository : IPackage 35 | { 36 | IPackageRepository Repository { get; } 37 | bool HasDependencies { get; } 38 | DateTime? LastUpdated { get; } 39 | Uri GalleryUrl { get; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageFromRepositoryExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageFromRepositoryExtensions.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public static class IPackageFromRepositoryExtensions 35 | { 36 | public static IDisposable StartInstallOperation(this IPackageFromRepository package) 37 | { 38 | return package.Repository.StartInstallOperation(package.Id, GetVersion(package.Version)); 39 | } 40 | 41 | public static IDisposable StartUpdateOperation(this IPackageFromRepository package) 42 | { 43 | return package.Repository.StartUpdateOperation(package.Id, GetVersion(package.Version)); 44 | } 45 | 46 | static string GetVersion(SemanticVersion version) 47 | { 48 | if (version != null) { 49 | return version.ToString(); 50 | } 51 | return null; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementFileService.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageManagementFileService.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IPackageManagementFileService 34 | { 35 | void RemoveFile(string path); 36 | void RemoveDirectory(string path); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementOutputMessagesView.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageManagementOutputMessagesView.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | using System; 29 | using NuGet; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IPackageManagementOutputMessagesView 34 | { 35 | void Clear(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageManagementProjectFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | using System; 29 | using MonoDevelop.Projects; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface IPackageManagementProjectFactory 35 | { 36 | IPackageManagementProject CreateProject(IPackageRepository sourceRepository, DotNetProject project); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementProjectService.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageManagementProjectService.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using MonoDevelop.Projects; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public interface IPackageManagementProjectService 36 | { 37 | Project CurrentProject { get; } 38 | Solution OpenSolution { get; } 39 | 40 | void Save(Project project); 41 | void Save(Solution solution); 42 | 43 | IEnumerable GetOpenProjects(); 44 | 45 | IProjectBrowserUpdater CreateProjectBrowserUpdater(); 46 | 47 | string GetDefaultCustomToolForFileName(ProjectFile projectItem); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagementSelectedProject.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageManagementSelectedProject.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public interface IPackageManagementSelectedProject 36 | { 37 | string Name { get; } 38 | bool IsSelected { get; set; } 39 | bool IsEnabled { get; set; } 40 | 41 | IPackageManagementProject Project { get; } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageManagerFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageManagerFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Projects; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public interface IPackageManagerFactory 36 | { 37 | ISharpDevelopPackageManager CreatePackageManager( 38 | IPackageRepository sourceRepository, 39 | DotNetProject project); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageOperationResolverFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageOperationResolverFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface IPackageOperationResolverFactory 35 | { 36 | IPackageOperationResolver CreateInstallPackageOperationResolver( 37 | IPackageRepository localRepository, 38 | IPackageRepository sourceRepository, 39 | ILogger logger, 40 | InstallPackageAction installAction); 41 | 42 | IPackageOperationResolver CreateUpdatePackageOperationResolver( 43 | IPackageRepository localRepository, 44 | IPackageRepository sourceRepository, 45 | ILogger logger, 46 | IUpdatePackageSettings settings); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryCache.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageRepositoryCache.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface IPackageRepositoryCache : ISharpDevelopPackageRepositoryFactory 35 | { 36 | IRecentPackageRepository RecentPackageRepository { get; } 37 | IPackageRepository CreateAggregateRepository(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageRepositoryExtensions.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public static class IPackageRepositoryExtensions 35 | { 36 | public static IDisposable StartInstallOperation(this IPackageRepository repository, string mainPackageId = null, string mainPackageVersion = null) 37 | { 38 | return repository.StartOperation(RepositoryOperationNames.Install, mainPackageId, mainPackageVersion); 39 | } 40 | 41 | public static IDisposable StartUpdateOperation(this IPackageRepository repository, string mainPackageId = null, string mainPackageVersion = null) 42 | { 43 | return repository.StartOperation(RepositoryOperationNames.Update, mainPackageId, mainPackageVersion); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageRepositoryFactoryEvents.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageRepositoryFactoryEvents.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IPackageRepositoryFactoryEvents 34 | { 35 | event EventHandler RepositoryCreated; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageViewModelFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface IPackageViewModelFactory 35 | { 36 | PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package); 37 | 38 | IPackageManagementSolution Solution { get; } 39 | PackageManagementSelectedProjects SelectedProjects { get; } 40 | IPackageManagementEvents PackageManagementEvents { get; } 41 | IPackageActionRunner PackageActionRunner { get; } 42 | ILogger Logger { get; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPackageViewModelParent.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPackageFromRepository.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IPackageViewModelParent 34 | { 35 | bool IncludePrerelease { get; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProcess.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IProcess.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IProcess 34 | { 35 | void Start(string fileName); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IProjectBrowserUpdater.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IProjectBrowserUpdater.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IProjectBrowserUpdater : IDisposable 34 | { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IPropertyService.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IPropertyService.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IPropertyService 34 | { 35 | string DataDirectory { get; } 36 | string ConfigDirectory { get; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRecentPackageRepository.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IRecentPackageRepository.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface IRecentPackageRepository : IPackageRepository 35 | { 36 | void Clear(); 37 | bool HasRecentPackages { get; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IRegisteredPackageRepositories.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IRegisteredPackageRepositories.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface IRegisteredPackageRepositories 35 | { 36 | IPackageRepository ActiveRepository { get; } 37 | IRecentPackageRepository RecentPackageRepository { get; } 38 | 39 | IPackageRepository CreateRepository(PackageSource source); 40 | IPackageRepository CreateAggregateRepository(); 41 | 42 | bool HasMultiplePackageSources { get; } 43 | PackageSource ActivePackageSource { get; set; } 44 | RegisteredPackageSources PackageSources { get; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISelectProjectsService.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ISelectProjectsService.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface ISelectProjectsService 35 | { 36 | bool SelectProjects(IEnumerable projects); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISettingsFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ISettingsFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface ISettingsFactory 35 | { 36 | ISettings CreateSettings(string directory); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopPackageRepositoryFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ISharpDevelopPackageRepositoryFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public interface ISharpDevelopPackageRepositoryFactory : IPackageRepositoryFactory 36 | { 37 | ISharedPackageRepository CreateSharedRepository( 38 | IPackagePathResolver pathResolver, 39 | IFileSystem fileSystem, 40 | IFileSystem configSettingsFileSystem); 41 | 42 | IRecentPackageRepository CreateRecentPackageRepository( 43 | IList recentPackages, 44 | IPackageRepository aggregateRepository); 45 | 46 | IPackageRepository CreateAggregateRepository(IEnumerable repositories); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectManager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ISharpDevelopProjectManager.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012-2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface ISharpDevelopProjectManager : IProjectManager 35 | { 36 | IPackagePathResolver PathResolver { get; } 37 | bool IsInstalled(string packageId); 38 | bool HasOlderPackageInstalled(IPackage package); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISharpDevelopProjectSystemFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ISharpDevelopProjectSystemFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Projects; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public interface ISharpDevelopProjectSystemFactory 36 | { 37 | IProjectSystem CreateProjectSystem(DotNetProject project); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepository.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ISolutionPackageRepository.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using System.Linq; 32 | 33 | using NuGet; 34 | 35 | namespace ICSharpCode.PackageManagement 36 | { 37 | public interface ISolutionPackageRepository 38 | { 39 | string GetInstallPath(IPackage package); 40 | IEnumerable GetPackagesByDependencyOrder(); 41 | IEnumerable GetPackagesByReverseDependencyOrder(); 42 | IQueryable GetPackages(); 43 | bool IsInstalled(IPackage package); 44 | 45 | ISharedPackageRepository Repository { get; } 46 | IFileSystem FileSystem { get; } 47 | IPackagePathResolver PackagePathResolver { get; } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ISolutionPackageRepositoryFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ISolutionPackageRepositoryFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Projects; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface ISolutionPackageRepositoryFactory 35 | { 36 | ISolutionPackageRepository CreateSolutionPackageRepository(Solution solution); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITask.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ITask.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface ITask 34 | { 35 | void Start(); 36 | void Cancel(); 37 | 38 | TResult Result { get; } 39 | 40 | bool IsCancelled { get; } 41 | bool IsFaulted { get; } 42 | AggregateException Exception { get; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ITaskFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ITaskFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface ITaskFactory 34 | { 35 | ITask CreateTask( 36 | Func function, 37 | Action> continueWith); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IThreadSafePackageManagementEvents.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IThreadSafePackageManagementEvents.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IThreadSafePackageManagementEvents : IPackageManagementEvents, IDisposable 34 | { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageActions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IUpdatePackageActions.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public interface IUpdatePackageActions : IUpdatePackageSettings 35 | { 36 | //IPackageScriptRunner PackageScriptRunner { get; set; } 37 | 38 | IEnumerable CreateActions(); 39 | } 40 | } -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackageSettings.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IUpdatePackageSettings.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public interface IUpdatePackageSettings 34 | { 35 | bool UpdateDependencies { get; set; } 36 | bool AllowPrereleaseVersions { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/IUpdatePackagesAction.cs: -------------------------------------------------------------------------------- 1 | // 2 | // IUpdatePackagesAction.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public interface IUpdatePackagesAction : IPackageAction, IUpdatePackageSettings 36 | { 37 | IEnumerable Operations { get; } 38 | ILogger Logger { get; set; } 39 | 40 | void AddPackages(IEnumerable packages); 41 | void AddOperations(IEnumerable operations); 42 | } 43 | } -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstallPackageAction.cs: -------------------------------------------------------------------------------- 1 | // 2 | // InstallPackageAction.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using System.IO; 32 | using NuGet; 33 | 34 | namespace ICSharpCode.PackageManagement 35 | { 36 | public class InstallPackageAction : ProcessPackageOperationsAction 37 | { 38 | public InstallPackageAction( 39 | IPackageManagementProject project, 40 | IPackageManagementEvents packageManagementEvents) 41 | : base(project, packageManagementEvents) 42 | { 43 | } 44 | 45 | public bool IgnoreDependencies { get; set; } 46 | 47 | protected override IEnumerable GetPackageOperations() 48 | { 49 | return Project.GetInstallPackageOperations(Package, this); 50 | } 51 | 52 | protected override void ExecuteCore() 53 | { 54 | Project.InstallPackage(Package, this); 55 | OnParentPackageInstalled(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/InstalledPackageViewModelFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // InstalledPackageViewModelFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public class InstalledPackageViewModelFactory : PackageViewModelFactory 34 | { 35 | SelectedProjectsForInstalledPackages selectedProjectsForInstalledPackages; 36 | 37 | public InstalledPackageViewModelFactory(IPackageViewModelFactory packageViewModelFactory) 38 | : base(packageViewModelFactory) 39 | { 40 | selectedProjectsForInstalledPackages = new SelectedProjectsForInstalledPackages(Solution); 41 | } 42 | 43 | public override PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package) 44 | { 45 | return new InstalledPackageViewModel( 46 | parent, 47 | package, 48 | selectedProjectsForInstalledPackages, 49 | PackageManagementEvents, 50 | PackageActionRunner, 51 | Logger); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceService.cs: -------------------------------------------------------------------------------- 1 | // 2 | // LicenseAcceptanceService.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using MonoDevelop.Ide; 32 | using MonoDevelop.PackageManagement; 33 | using NuGet; 34 | 35 | namespace ICSharpCode.PackageManagement 36 | { 37 | public class LicenseAcceptanceService : ILicenseAcceptanceService 38 | { 39 | public bool AcceptLicenses(IEnumerable packages) 40 | { 41 | LicenseAcceptanceDialog dialog = CreateLicenseAcceptanceDialog(packages); 42 | int result = MessageService.ShowCustomDialog(dialog); 43 | return result == (int)Gtk.ResponseType.Ok; 44 | } 45 | 46 | LicenseAcceptanceDialog CreateLicenseAcceptanceDialog(IEnumerable packages) 47 | { 48 | var viewModel = new LicenseAcceptanceViewModel(packages); 49 | return new LicenseAcceptanceDialog(viewModel); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/LicenseAcceptanceViewModel.cs: -------------------------------------------------------------------------------- 1 | // 2 | // LicenseAcceptanceViewModel.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using System.Linq; 32 | using NuGet; 33 | 34 | namespace ICSharpCode.PackageManagement 35 | { 36 | public class LicenseAcceptanceViewModel : ViewModelBase 37 | { 38 | IList packages; 39 | 40 | public LicenseAcceptanceViewModel(IEnumerable packages) 41 | { 42 | this.packages = packages 43 | .Select(p => new PackageLicenseViewModel(p)) 44 | .ToList(); 45 | } 46 | 47 | public IEnumerable Packages { 48 | get { return packages; } 49 | } 50 | 51 | public bool HasOnePackage { 52 | get { return packages.Count == 1; } 53 | } 54 | 55 | public bool HasMultiplePackages { 56 | get { return packages.Count > 1; } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MachinePackageCache.cs: -------------------------------------------------------------------------------- 1 | // 2 | // MachinePackageCache.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Linq; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class MachinePackageCache : IMachinePackageCache 36 | { 37 | public IQueryable GetPackages() 38 | { 39 | return MachineCache.Default.GetPackages(); 40 | } 41 | 42 | public void Clear() 43 | { 44 | MachineCache.Default.Clear(); 45 | } 46 | 47 | public string Source { 48 | get { return MachineCache.Default.Source; } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ManagePackagesViewTitle.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ManagePackagesViewTitle.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public class ManagePackagesViewTitle 34 | { 35 | public ManagePackagesViewTitle(IPackageManagementSolution solution) 36 | { 37 | GetTitle(solution); 38 | } 39 | 40 | void GetTitle(IPackageManagementSolution solution) 41 | { 42 | var selectedProjects = new PackageManagementSelectedProjects(solution); 43 | string selectionName = selectedProjects.SelectionName; 44 | Title = String.Format("{0} - Manage Packages", selectionName); 45 | } 46 | 47 | public string Title { get; private set; } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MarkupString.cs: -------------------------------------------------------------------------------- 1 | // 2 | // StringExtensions.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Linq; 31 | using GLib; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public static class MarkupString 36 | { 37 | public static string Format (string format, params string[] args) 38 | { 39 | string[] escapedArgs = args.Select (s => Markup.EscapeText (s)).ToArray(); 40 | return String.Format (format, escapedArgs); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopCredentialProvider.cs: -------------------------------------------------------------------------------- 1 | // 2 | // MonoDevelopCredentialProvider.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Net; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class MonoDevelopCredentialProvider : ICredentialProvider 36 | { 37 | public ICredentials GetCredentials(Uri uri, IWebProxy proxy, CredentialType credentialType, bool retrying) 38 | { 39 | return null; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/MonoDevelopHttpUserAgent.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SharpDevelopHttpUserAgent.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Core; 31 | using MonoDevelop.Ide; 32 | using NuGet; 33 | 34 | namespace ICSharpCode.PackageManagement 35 | { 36 | public class MonoDevelopHttpUserAgent 37 | { 38 | public MonoDevelopHttpUserAgent() 39 | { 40 | CreateUserAgent(); 41 | } 42 | 43 | public string Client { get; private set; } 44 | public string Host { get; private set; } 45 | public string UserAgent { get; private set; } 46 | 47 | void CreateUserAgent() 48 | { 49 | Client = BrandingService.ApplicationName; 50 | Host = GetHost(); 51 | UserAgent = HttpUtility.CreateUserAgentString(Client, Host); 52 | } 53 | 54 | string GetHost() 55 | { 56 | return String.Format("{0}/{1}", Client, IdeApp.Version); 57 | } 58 | 59 | public override string ToString() 60 | { 61 | return UserAgent; 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/NuGetExePath.cs: -------------------------------------------------------------------------------- 1 | // 2 | // NuGetExePath.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.IO; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public static class NuGetExePath 35 | { 36 | public static string GetPath() 37 | { 38 | return Path.Combine(GetDirectory(), "NuGet.exe"); 39 | } 40 | 41 | static string GetDirectory() 42 | { 43 | return Path.GetDirectoryName(typeof(NuGetExePath).Assembly.Location); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/OpenDotNetProjects.cs: -------------------------------------------------------------------------------- 1 | // 2 | // OpenDotNetProjects.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using MonoDevelop.Projects; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class OpenDotNetProjects 36 | { 37 | IPackageManagementProjectService projectService; 38 | 39 | public OpenDotNetProjects(IPackageManagementProjectService projectService) 40 | { 41 | this.projectService = projectService; 42 | } 43 | 44 | public DotNetProject FindProject(string name) 45 | { 46 | foreach (Project project in projectService.GetOpenProjects()) { 47 | if (IsProjectNameMatch(project, name)) { 48 | return project as DotNetProject; 49 | } 50 | } 51 | return null; 52 | } 53 | 54 | bool IsProjectNameMatch(Project project, string name) 55 | { 56 | return IsMatchIgnoringCase(project.Name, name) || 57 | (project.FileName == name); 58 | } 59 | 60 | bool IsMatchIgnoringCase(string a, string b) 61 | { 62 | return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFilesForOperations.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageFilesForOperations.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class PackageFilesForOperations 36 | { 37 | IEnumerable operations; 38 | 39 | public PackageFilesForOperations(IEnumerable operations) 40 | { 41 | this.operations = operations; 42 | } 43 | 44 | public bool HasAnyPackageScripts() 45 | { 46 | foreach (PackageFiles files in GetPackageFilesForEachOperation()) { 47 | if (files.HasAnyPackageScripts()) { 48 | return true; 49 | } 50 | } 51 | return false; 52 | } 53 | 54 | IEnumerable GetPackageFilesForEachOperation() 55 | { 56 | foreach (PackageOperation operation in operations) { 57 | yield return new PackageFiles(operation.Package); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageLicenseViewModel.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageLicenseViewModel.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class PackageLicenseViewModel : ViewModelBase 35 | { 36 | IPackage package; 37 | 38 | public PackageLicenseViewModel(IPackage package) 39 | { 40 | this.package = package; 41 | } 42 | 43 | public string Id { 44 | get { return package.Id; } 45 | } 46 | 47 | public string Summary { 48 | get { return package.SummaryOrDescription(); } 49 | } 50 | 51 | public Uri LicenseUrl { 52 | get { return package.LicenseUrl; } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementCompilerMessageView.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageManagementCompilerMessageView.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public class PackageManagementCompilerMessageView : ICompilerMessageView 34 | { 35 | public IMessageViewCategory Create(string categoryName, string categoryDisplayName) 36 | { 37 | // MessageViewCategory view = null; 38 | // MessageViewCategory.Create(ref view, categoryName, categoryDisplayName); 39 | return new PackageManagementMessageViewCategory(); 40 | } 41 | 42 | public IMessageViewCategory GetExisting(string categoryName) 43 | { 44 | // MessageViewCategory view = CompilerMessageView.Instance.GetCategory(categoryName); 45 | // if (view != null) { 46 | return new PackageManagementMessageViewCategory(); 47 | // } 48 | // return null; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageManagementEnumerableExtensions.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public static class PackageManagementEnumerableExtensions 36 | { 37 | public static IEnumerable DistinctLast(this IEnumerable source, IEqualityComparer comparer) 38 | { 39 | TSource previousItem = default(TSource); 40 | 41 | foreach (TSource currentItem in source) { 42 | if (previousItem != null) { 43 | if (!comparer.Equals(previousItem, currentItem)) { 44 | yield return previousItem; 45 | } 46 | } 47 | previousItem = currentItem; 48 | } 49 | 50 | if (previousItem != null) { 51 | yield return previousItem; 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementFileService.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageManagementFileService.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.IO; 31 | using MonoDevelop.Core; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class PackageManagementFileService : IPackageManagementFileService 36 | { 37 | public void RemoveFile(string path) 38 | { 39 | FileService.DeleteFile(path); 40 | } 41 | 42 | public void RemoveDirectory(string path) 43 | { 44 | FileService.DeleteDirectory(path); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementLogger.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageManagementLogger.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class PackageManagementLogger : ILogger 35 | { 36 | IPackageManagementEvents packageManagementEvents; 37 | 38 | public PackageManagementLogger(IPackageManagementEvents packageManagementEvents) 39 | { 40 | this.packageManagementEvents = packageManagementEvents; 41 | } 42 | 43 | public void Log(MessageLevel level, string message, params object[] args) 44 | { 45 | packageManagementEvents.OnPackageOperationMessageLogged(level, message, args); 46 | } 47 | 48 | public FileConflictResolution ResolveFileConflict(string message) 49 | { 50 | return packageManagementEvents.OnResolveFileConflict(message); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementMessageViewCategory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageManagementMessageViewCategory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public class PackageManagementMessageViewCategory : IMessageViewCategory 34 | { 35 | // MessageViewCategory messageViewCategory; 36 | // 37 | // public PackageManagementMessageViewCategory(MessageViewCategory messageViewCategory) 38 | // { 39 | // this.messageViewCategory = messageViewCategory; 40 | // } 41 | 42 | public void AppendLine(string text) 43 | { 44 | // messageViewCategory.AppendLine(text); 45 | } 46 | 47 | public void Clear() 48 | { 49 | // messageViewCategory.ClearText(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementProjectFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageManagementProjectFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Projects; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class PackageManagementProjectFactory : IPackageManagementProjectFactory 36 | { 37 | SharpDevelopPackageManagerFactory factory = new SharpDevelopPackageManagerFactory(); 38 | IPackageManagementEvents packageManagementEvents; 39 | 40 | public PackageManagementProjectFactory(IPackageManagementEvents packageManagementEvents) 41 | { 42 | this.packageManagementEvents = packageManagementEvents; 43 | } 44 | 45 | public IPackageManagementProject CreateProject( 46 | IPackageRepository sourceRepository, 47 | DotNetProject project) 48 | { 49 | return new PackageManagementProject(sourceRepository, project, packageManagementEvents, factory); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementPropertyService.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageManagementPropertyService.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Core; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class PackageManagementPropertyService : IPropertyService 35 | { 36 | public string DataDirectory { 37 | get { return UserProfile.Current.ConfigDir; } 38 | } 39 | 40 | public string ConfigDirectory { 41 | get { return UserProfile.Current.ConfigDir; } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementTaskFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageManagementTaskFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using System.Threading.Tasks; 32 | 33 | using NuGet; 34 | 35 | namespace ICSharpCode.PackageManagement 36 | { 37 | public class PackageManagementTaskFactory : ITaskFactory 38 | { 39 | public ITask CreateTask( 40 | Func function, 41 | Action> continueWith) 42 | { 43 | return new PackageManagementTask(function, continueWith); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationExceptionEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageOperationExceptionEventArgs.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public class PackageOperationExceptionEventArgs : EventArgs 34 | { 35 | public PackageOperationExceptionEventArgs(Exception ex) 36 | { 37 | Exception = ex; 38 | } 39 | 40 | public Exception Exception { get; private set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessage.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageOperationMessage.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class PackageOperationMessage 35 | { 36 | string message; 37 | object[] args; 38 | 39 | public PackageOperationMessage( 40 | MessageLevel level, 41 | string message, 42 | params object[] args) 43 | { 44 | this.Level = level; 45 | this.message = message; 46 | this.args = args; 47 | } 48 | 49 | public MessageLevel Level { get; private set; } 50 | 51 | public override string ToString() 52 | { 53 | return String.Format(message, args); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageOperationMessageLoggedEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageOperationMessageLoggedEventArgs.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class PackageOperationMessageLoggedEventArgs : EventArgs 35 | { 36 | public PackageOperationMessageLoggedEventArgs( 37 | MessageLevel level, 38 | string message, 39 | params object[] args) 40 | { 41 | this.Message = new PackageOperationMessage(level, message, args); 42 | } 43 | 44 | public PackageOperationMessage Message { get; private set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRepositoryFactoryEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageRepositoryFactoryEventArgs.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class PackageRepositoryFactoryEventArgs : EventArgs 35 | { 36 | public PackageRepositoryFactoryEventArgs(IPackageRepository repository) 37 | { 38 | this.Repository = repository; 39 | } 40 | 41 | public IPackageRepository Repository { get; private set; } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageSourceExtensions.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public static class PackageSourceExtensions 35 | { 36 | public static bool IsAggregate(this PackageSource packageSource) 37 | { 38 | return packageSource.Source == RegisteredPackageSourceSettings.AggregatePackageSource.Source; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageSourceViewModel.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackageSourceViewModel.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class PackageSourceViewModel : ViewModelBase 35 | { 36 | RegisteredPackageSource packageSource; 37 | 38 | public PackageSourceViewModel(PackageSource packageSource) 39 | { 40 | this.packageSource = new RegisteredPackageSource(packageSource); 41 | } 42 | 43 | public PackageSource GetPackageSource() 44 | { 45 | return packageSource.ToPackageSource(); 46 | } 47 | 48 | public string Name { 49 | get { return packageSource.Name; } 50 | set { packageSource.Name = value; } 51 | } 52 | 53 | public string SourceUrl { 54 | get { return packageSource.Source; } 55 | set { packageSource.Source = value; } 56 | } 57 | 58 | public bool IsEnabled { 59 | get { return packageSource.IsEnabled; } 60 | set { packageSource.IsEnabled = value; } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackagesForSelectedPageResult.cs: -------------------------------------------------------------------------------- 1 | // 2 | // PackagesForSelectedPageResult.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using System.Linq; 32 | 33 | using NuGet; 34 | 35 | namespace ICSharpCode.PackageManagement 36 | { 37 | public class PackagesForSelectedPageResult 38 | { 39 | public PackagesForSelectedPageResult(IEnumerable packages, int totalPackages) 40 | { 41 | this.Packages = packages; 42 | this.TotalPackagesOnPage = packages.Count(); 43 | this.TotalPackages = totalPackages; 44 | } 45 | 46 | public IEnumerable Packages { get; set; } 47 | public int TotalPackagesOnPage { get; set; } 48 | public int TotalPackages { get; set; } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Page.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Page.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public class Page 34 | { 35 | public int Number { get; set; } 36 | public bool IsSelected { get; set; } 37 | 38 | public override string ToString() 39 | { 40 | return String.Format("[Page] Number={0}, IsSelected={1}", Number, IsSelected); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackageOperationEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ParentPackageOperationEventArgs.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class ParentPackageOperationEventArgs : EventArgs 35 | { 36 | public ParentPackageOperationEventArgs(IPackage package) 37 | { 38 | this.Package = package; 39 | } 40 | 41 | public IPackage Package { get; private set; } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ParentPackagesOperationEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ParentPackagesOperationEventArgs.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class ParentPackagesOperationEventArgs : EventArgs 36 | { 37 | public ParentPackagesOperationEventArgs(IEnumerable packages) 38 | { 39 | this.Packages = packages; 40 | } 41 | 42 | public IEnumerable Packages { get; private set; } 43 | } 44 | } -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/Process.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Process.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public class Process : IProcess 34 | { 35 | public void Start(string fileName) 36 | { 37 | System.Diagnostics.Process.Start(fileName); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ProjectExtensions.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Core.ProgressMonitoring; 31 | using MonoDevelop.Projects; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public static class ProjectExtensions 36 | { 37 | public static void Save(this Project project) 38 | { 39 | project.Save(new NullProgressMonitor()); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProjectTemplatePackageSettingsFileName.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ProjectTemplatePackageSettingsFileName.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.IO; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class ProjectTemplatePackagesSettingsFileName 35 | { 36 | string directory; 37 | 38 | public ProjectTemplatePackagesSettingsFileName(IPropertyService propertyService) 39 | { 40 | directory = Path.Combine(propertyService.ConfigDirectory, "templates"); 41 | } 42 | 43 | public string Directory { 44 | get { return directory; } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RecentPackageInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // RecentPackageInfo.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class RecentPackageInfo 35 | { 36 | SemanticVersion version; 37 | 38 | public RecentPackageInfo() 39 | { 40 | } 41 | 42 | public RecentPackageInfo(IPackage package) 43 | : this(package.Id, package.Version) 44 | { 45 | } 46 | 47 | public RecentPackageInfo(string id, SemanticVersion version) 48 | { 49 | this.Id = id; 50 | this.version = version; 51 | } 52 | 53 | public string Id { get; set; } 54 | 55 | public string Version { 56 | get { return version.ToString(); } 57 | set { version = new SemanticVersion(value); } 58 | } 59 | 60 | public override string ToString() 61 | { 62 | return String.Format("[RecentPackageInfo Id={0}, Version={1}]", Id, Version); 63 | } 64 | 65 | public bool IsMatch(IPackage package) 66 | { 67 | return (package.Version.ToString() == Version) && (package.Id == Id); 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSource.cs: -------------------------------------------------------------------------------- 1 | // 2 | // RegisteredPackageSource.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class RegisteredPackageSource 35 | { 36 | public string Source { get; set; } 37 | public string Name { get; set; } 38 | public bool IsEnabled { get; set; } 39 | 40 | public RegisteredPackageSource() 41 | { 42 | } 43 | 44 | public RegisteredPackageSource(PackageSource packageSource) 45 | { 46 | Source = packageSource.Source; 47 | Name = packageSource.Name; 48 | IsEnabled = packageSource.IsEnabled; 49 | } 50 | 51 | public PackageSource ToPackageSource() 52 | { 53 | return new PackageSource(Source, Name, IsEnabled); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RemovedPackageReferenceMonitor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // RemovedPackageReferenceMonitor.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class RemovedPackageReferenceMonitor : IDisposable 36 | { 37 | ISharpDevelopProjectManager projectManager; 38 | List packagesRemoved = new List(); 39 | 40 | public RemovedPackageReferenceMonitor(ISharpDevelopProjectManager projectManager) 41 | { 42 | this.projectManager = projectManager; 43 | projectManager.PackageReferenceRemoved += PackageReferenceRemoved; 44 | } 45 | 46 | void PackageReferenceRemoved(object sender, PackageOperationEventArgs e) 47 | { 48 | packagesRemoved.Add(e.Package); 49 | } 50 | 51 | public void Dispose() 52 | { 53 | projectManager.PackageReferenceRemoved -= PackageReferenceRemoved; 54 | } 55 | 56 | public List PackagesRemoved { 57 | get { return packagesRemoved; } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ResolveFileConflictEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ResolveFileConflictEventArgs.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class ResolveFileConflictEventArgs : EventArgs 35 | { 36 | public ResolveFileConflictEventArgs(string message) 37 | { 38 | this.Message = message; 39 | this.Resolution = FileConflictResolution.Ignore; 40 | } 41 | 42 | public string Message { get; private set; } 43 | public FileConflictResolution Resolution { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsEventArgs.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SelectProjectsEventArgs.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class SelectProjectsEventArgs : EventArgs 35 | { 36 | public SelectProjectsEventArgs(IEnumerable selectedProjects) 37 | { 38 | this.SelectedProjects = selectedProjects; 39 | } 40 | 41 | public IEnumerable SelectedProjects { get; private set; } 42 | 43 | public bool IsAccepted { get; set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsService.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SelectProjectsService.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using MonoDevelop.Ide; 32 | using MonoDevelop.PackageManagement; 33 | 34 | namespace ICSharpCode.PackageManagement 35 | { 36 | public class SelectProjectsService : ISelectProjectsService 37 | { 38 | public bool SelectProjects(IEnumerable projects) 39 | { 40 | SelectProjectsDialog dialog = CreateSelectProjectsDialog(projects); 41 | int result = MessageService.ShowCustomDialog(dialog); 42 | return result == (int)Gtk.ResponseType.Ok; 43 | } 44 | 45 | SelectProjectsDialog CreateSelectProjectsDialog(IEnumerable projects) 46 | { 47 | var viewModel = new SelectProjectsViewModel(projects); 48 | return new SelectProjectsDialog(viewModel); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectProjectsViewModel.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SelectProjectsViewModel.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Collections.Generic; 31 | using System.Collections.ObjectModel; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class SelectProjectsViewModel 36 | { 37 | ObservableCollection projects = 38 | new ObservableCollection(); 39 | 40 | public SelectProjectsViewModel(IEnumerable projects) 41 | { 42 | AddProjects(projects); 43 | } 44 | 45 | void AddProjects(IEnumerable projects) 46 | { 47 | foreach (IPackageManagementSelectedProject project in projects) { 48 | AddProject(project); 49 | } 50 | } 51 | 52 | void AddProject(IPackageManagementSelectedProject project) 53 | { 54 | projects.Add(project); 55 | } 56 | 57 | public ObservableCollection Projects { 58 | get { return projects; } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForInstalledPackages.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SelectedProjectsForInstalledPackages.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public class SelectedProjectsForInstalledPackages : PackageManagementSelectedProjects 34 | { 35 | public SelectedProjectsForInstalledPackages(IPackageManagementSolution solution) 36 | : base(solution) 37 | { 38 | } 39 | 40 | protected override bool IsProjectSelected(IPackageManagementProject project, IPackageFromRepository package) 41 | { 42 | return project.IsPackageInstalled(package); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SelectedProjectsForUpdatedPackages.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SelectedProjectsForUpdatedPackages.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.Linq; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class SelectedProjectsForUpdatedPackages : PackageManagementSelectedProjects 36 | { 37 | public SelectedProjectsForUpdatedPackages(IPackageManagementSolution solution) 38 | : base(solution) 39 | { 40 | } 41 | 42 | protected override bool IsProjectSelected(IPackageManagementProject project, IPackageFromRepository package) 43 | { 44 | return IsProjectEnabled(project, package); 45 | } 46 | 47 | protected override bool IsProjectEnabled(IPackageManagementProject project, IPackageFromRepository package) 48 | { 49 | return project.GetPackages() 50 | .Where(p => IsPackageIdMatch(p.Id, package.Id)) 51 | .Any(p => p.Version < package.Version); 52 | } 53 | 54 | bool IsPackageIdMatch(string id1, string id2) 55 | { 56 | return String.Equals(id1, id2, StringComparison.InvariantCultureIgnoreCase); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class SettingsFactory : ISettingsFactory 35 | { 36 | public ISettings CreateSettings(string directory) 37 | { 38 | var fileSystem = new PhysicalFileSystem(directory); 39 | return new Settings(fileSystem); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectManager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SharpDevelopProjectManager.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class SharpDevelopProjectManager : ProjectManager, ISharpDevelopProjectManager 35 | { 36 | public SharpDevelopProjectManager( 37 | IPackageRepository sourceRepository, 38 | IPackagePathResolver pathResolver, 39 | IProjectSystem project, 40 | IPackageRepository localRepository) 41 | : base(sourceRepository, pathResolver, project, localRepository) 42 | { 43 | } 44 | 45 | public bool IsInstalled(string packageId) 46 | { 47 | return LocalRepository.Exists(packageId); 48 | } 49 | 50 | public bool HasOlderPackageInstalled(IPackage package) 51 | { 52 | IPackage installedPackage = LocalRepository.FindPackage(package.Id); 53 | return (installedPackage != null) && 54 | (installedPackage.Version < package.Version); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SharpDevelopProjectSystemFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SharpDevelopProjectSystemFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Projects; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class SharpDevelopProjectSystemFactory : ISharpDevelopProjectSystemFactory 36 | { 37 | public IProjectSystem CreateProjectSystem(DotNetProject project) 38 | { 39 | return new SharpDevelopProjectSystem(project); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionExtensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SolutionExtensions.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Core.ProgressMonitoring; 31 | using MonoDevelop.Projects; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public static class SolutionExtensions 36 | { 37 | public static void Save(this Solution solution) 38 | { 39 | solution.Save(new NullProgressMonitor()); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SolutionPackageRepositoryFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // SolutionPackageRepositoryFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using MonoDevelop.Projects; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class SolutionPackageRepositoryFactory : ISolutionPackageRepositoryFactory 36 | { 37 | ISharpDevelopPackageRepositoryFactory repositoryFactory; 38 | PackageManagementOptions options; 39 | 40 | public SolutionPackageRepositoryFactory() 41 | : this(PackageManagementServices.PackageRepositoryCache, PackageManagementServices.Options) 42 | { 43 | } 44 | 45 | public SolutionPackageRepositoryFactory( 46 | ISharpDevelopPackageRepositoryFactory repositoryFactory, 47 | PackageManagementOptions options) 48 | { 49 | this.repositoryFactory = repositoryFactory; 50 | this.options = options; 51 | } 52 | 53 | public ISolutionPackageRepository CreateSolutionPackageRepository(Solution solution) 54 | { 55 | return new SolutionPackageRepository(solution, repositoryFactory, options); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ThreadSafeProjectBrowserUpdater.cs: -------------------------------------------------------------------------------- 1 | // 2 | // ThreadSafeProjectBrowserUpdater.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | 31 | namespace ICSharpCode.PackageManagement 32 | { 33 | public class ThreadSafeProjectBrowserUpdater : ProjectBrowserUpdater 34 | { 35 | // public ThreadSafeProjectBrowserUpdater() 36 | // : base(GetProjectBrowserControl()) 37 | // { 38 | // } 39 | // 40 | // static ProjectBrowserControl GetProjectBrowserControl() 41 | // { 42 | // if (WorkbenchSingleton.InvokeRequired) { 43 | // return WorkbenchSingleton.SafeThreadFunction(() => GetProjectBrowserControl()); 44 | // } else { 45 | // return ProjectBrowserPad.Instance.ProjectBrowserControl; 46 | // } 47 | // } 48 | // 49 | // protected override void ProjectItemAdded(object sender, ProjectItemEventArgs e) 50 | // { 51 | // WorkbenchSingleton.SafeThreadAsyncCall(() => base.ProjectItemAdded(sender, e)); 52 | // } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UninstallPackageAction.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UninstallPackageAction.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2012 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using System.IO; 31 | using NuGet; 32 | 33 | namespace ICSharpCode.PackageManagement 34 | { 35 | public class UninstallPackageAction : ProcessPackageAction 36 | { 37 | public UninstallPackageAction( 38 | IPackageManagementProject project, 39 | IPackageManagementEvents packageManagementEvents) 40 | : base(project, packageManagementEvents) 41 | { 42 | this.AllowPrereleaseVersions = true; 43 | } 44 | 45 | public bool ForceRemove { get; set; } 46 | public bool RemoveDependencies { get; set; } 47 | 48 | protected override void BeforeExecute() 49 | { 50 | base.BeforeExecute(); 51 | } 52 | 53 | protected override void ExecuteCore() 54 | { 55 | Project.UninstallPackage(Package, this); 56 | OnParentPackageUninstalled(); 57 | } 58 | 59 | public override bool HasPackageScriptsToRun() 60 | { 61 | var files = new PackageFiles(Package); 62 | return files.HasUninstallPackageScript(); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModel.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UpdatedPackageViewModel.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class UpdatedPackageViewModel : PackageViewModel 35 | { 36 | public UpdatedPackageViewModel( 37 | IPackageViewModelParent parent, 38 | IPackageFromRepository package, 39 | SelectedProjectsForUpdatedPackages selectedProjects, 40 | IPackageManagementEvents packageManagementEvents, 41 | IPackageActionRunner actionRunner, 42 | ILogger logger) 43 | : base(parent, package, selectedProjects, packageManagementEvents, actionRunner, logger) 44 | { 45 | } 46 | 47 | protected override ProcessPackageOperationsAction CreateInstallPackageAction( 48 | IPackageManagementProject project) 49 | { 50 | return project.CreateUpdatePackageAction(); 51 | } 52 | 53 | protected override IDisposable StartInstallOperation(IPackageFromRepository package) 54 | { 55 | return package.StartUpdateOperation(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UpdatedPackageViewModelFactory.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UpdatePackageViewModelFactory.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class UpdatedPackageViewModelFactory : PackageViewModelFactory 35 | { 36 | SelectedProjectsForUpdatedPackages selectedProjectsForUpdatedPackages; 37 | 38 | public UpdatedPackageViewModelFactory(IPackageViewModelFactory packageViewModelFactory) 39 | : base(packageViewModelFactory) 40 | { 41 | selectedProjectsForUpdatedPackages = new SelectedProjectsForUpdatedPackages(Solution); 42 | } 43 | 44 | public override PackageViewModel CreatePackageViewModel(IPackageViewModelParent parent, IPackageFromRepository package) 45 | { 46 | return new UpdatedPackageViewModel( 47 | parent, 48 | package, 49 | selectedProjectsForUpdatedPackages, 50 | PackageManagementEvents, 51 | PackageActionRunner, 52 | Logger); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/UserAgentGeneratorForRepositoryRequests.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UserAgentGeneratorForRepositoryRequests.cs 3 | // 4 | // Author: 5 | // Matt Ward 6 | // 7 | // Copyright (C) 2013 Matthew Ward 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | 29 | using System; 30 | using NuGet; 31 | 32 | namespace ICSharpCode.PackageManagement 33 | { 34 | public class UserAgentGeneratorForRepositoryRequests 35 | { 36 | MonoDevelopHttpUserAgent userAgent = new MonoDevelopHttpUserAgent(); 37 | 38 | public UserAgentGeneratorForRepositoryRequests(IPackageRepositoryFactoryEvents repositoryFactoryEvents) 39 | { 40 | repositoryFactoryEvents.RepositoryCreated += RepositoryCreated; 41 | } 42 | 43 | void RepositoryCreated(object sender, PackageRepositoryFactoryEventArgs e) 44 | { 45 | RegisterHttpClient(e.Repository as IHttpClientEvents); 46 | } 47 | 48 | void RegisterHttpClient(IHttpClientEvents clientEvents) 49 | { 50 | if (clientEvents != null) { 51 | clientEvents.SendingRequest += SendingRequest; 52 | } 53 | } 54 | 55 | void SendingRequest(object sender, WebRequestEventArgs e) 56 | { 57 | HttpUtility.SetUserAgent(e.Request, userAgent.ToString()); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/PostBuildEvent.proj: -------------------------------------------------------------------------------- 1 |  2 | 3 | $(PrepareForRunDependsOn);MyPostBuildTarget 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/gtk-gui/MonoDevelop.PackageManagement.HyperlinkWidget.cs: -------------------------------------------------------------------------------- 1 | 2 | // This file has been generated by the GUI designer. Do not modify. 3 | namespace MonoDevelop.PackageManagement 4 | { 5 | public partial class HyperlinkWidget 6 | { 7 | protected virtual void Build () 8 | { 9 | global::Stetic.Gui.Initialize (this); 10 | // Widget MonoDevelop.PackageManagement.HyperlinkWidget 11 | global::Stetic.BinContainer.Attach (this); 12 | this.Name = "MonoDevelop.PackageManagement.HyperlinkWidget"; 13 | if ((this.Child != null)) { 14 | this.Child.ShowAll (); 15 | } 16 | this.Hide (); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/MonoDevelop.PackageManagement/icons/packageicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrward/monodevelop-nuget-addin/08b2d57263f1b991253fe9001b97384d56d9d5f7/src/MonoDevelop.PackageManagement/icons/packageicon.png --------------------------------------------------------------------------------