You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
3.0 KiB

  1. // Copyright (c) 2019 AlphaSierraPapa for the SharpDevelop Team
  2. //
  3. // Permission is hereby granted, free of charge, to any person obtaining a copy of this
  4. // software and associated documentation files (the "Software"), to deal in the Software
  5. // without restriction, including without limitation the rights to use, copy, modify, merge,
  6. // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
  7. // to whom the Software is furnished to do so, subject to the following conditions:
  8. //
  9. // The above copyright notice and this permission notice shall be included in all copies or
  10. // substantial portions of the Software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  13. // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  14. // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
  15. // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  16. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  17. // DEALINGS IN THE SOFTWARE.
  18. using System;
  19. namespace ICSharpCode.Decompiler.Solution
  20. {
  21. /// <summary>
  22. /// A container class that holds platform and GUID information about a Visual Studio project.
  23. /// </summary>
  24. public class ProjectId
  25. {
  26. /// <summary>
  27. /// Initializes a new instance of the <see cref="ProjectId"/> class.
  28. /// </summary>
  29. /// <param name="projectPlatform">The project platform.</param>
  30. /// <param name="projectGuid">The project GUID.</param>
  31. ///
  32. /// <exception cref="ArgumentException">Thrown when <paramref name="projectPlatform"/> is null or empty.</exception>
  33. public ProjectId(string projectPlatform, Guid projectGuid, Guid typeGuid)
  34. {
  35. if (string.IsNullOrWhiteSpace(projectPlatform))
  36. {
  37. throw new ArgumentException("The platform cannot be null or empty.", nameof(projectPlatform));
  38. }
  39. Guid = projectGuid;
  40. TypeGuid = typeGuid;
  41. PlatformName = projectPlatform;
  42. }
  43. /// <summary>
  44. /// Gets the GUID of this project.
  45. /// This is usually a newly generated GUID for each decompiled project.
  46. /// </summary>
  47. public Guid Guid { get; }
  48. /// <summary>
  49. /// Gets the primary type GUID of this project.
  50. /// This is one of the GUIDs from <see cref="ProjectTypeGuids"/>.
  51. /// </summary>
  52. public Guid TypeGuid { get; }
  53. /// <summary>
  54. /// Gets the platform name of this project. Only single platform per project is supported.
  55. /// </summary>
  56. public string PlatformName { get; }
  57. }
  58. public static class ProjectTypeGuids
  59. {
  60. public static readonly Guid SolutionFolder = Guid.Parse("{2150E333-8FDC-42A3-9474-1A3956D46DE8}");
  61. public static readonly Guid CSharpWindows = Guid.Parse("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}");
  62. public static readonly Guid CSharpCore = Guid.Parse("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}");
  63. public static readonly Guid Silverlight = Guid.Parse("{A1591282-1198-4647-A2B1-27E5FF5F6F3B}");
  64. public static readonly Guid PortableLibrary = Guid.Parse("{786C830F-07A1-408B-BD7F-6EE04809D6DB}");
  65. }
  66. }