The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
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.

HelpAreaRegistration.cs 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using System.Web.Optimization;
  4. using Teknik.Configuration;
  5. namespace Teknik.Areas.Help
  6. {
  7. public class HelpAreaRegistration : AreaRegistration
  8. {
  9. public override string AreaName
  10. {
  11. get
  12. {
  13. return "Help";
  14. }
  15. }
  16. public override void RegisterArea(AreaRegistrationContext context)
  17. {
  18. Config config = Config.Load();
  19. context.MapSubdomainRoute(
  20. "Help.Index", // Route name
  21. new List<string>() { "help" }, // Subdomains
  22. new List<string>() { config.Host }, // domains
  23. "", // URL with parameters
  24. new { controller = "Help", action = "Index" }, // Parameter defaults
  25. new[] { typeof(Controllers.HelpController).Namespace }
  26. );
  27. context.MapSubdomainRoute(
  28. "Help.API", // Route name
  29. new List<string>() { "help" }, // Subdomains
  30. new List<string>() { config.Host }, // domains
  31. "API/{version}/{service}", // URL with parameters
  32. new { controller = "Help", action = "API", version = UrlParameter.Optional, service = UrlParameter.Optional }, // Parameter defaults
  33. new[] { typeof(Controllers.HelpController).Namespace }
  34. );
  35. context.MapSubdomainRoute(
  36. "Help.Blog", // Route name
  37. new List<string>() { "help" }, // Subdomains
  38. new List<string>() { config.Host }, // domains
  39. "Blog", // URL with parameters
  40. new { controller = "Help", action = "Blog" }, // Parameter defaults
  41. new[] { typeof(Controllers.HelpController).Namespace }
  42. );
  43. context.MapSubdomainRoute(
  44. "Help.Git", // Route name
  45. new List<string>() { "help" }, // Subdomains
  46. new List<string>() { config.Host }, // domains
  47. "Git", // URL with parameters
  48. new { controller = "Help", action = "Git" }, // Parameter defaults
  49. new[] { typeof(Controllers.HelpController).Namespace }
  50. );
  51. context.MapSubdomainRoute(
  52. "Help.IRC", // Route name
  53. new List<string>() { "help" }, // Subdomains
  54. new List<string>() { config.Host }, // domains
  55. "IRC", // URL with parameters
  56. new { controller = "Help", action = "IRC" }, // Parameter defaults
  57. new[] { typeof(Controllers.HelpController).Namespace }
  58. );
  59. context.MapSubdomainRoute(
  60. "Help.Mail", // Route name
  61. new List<string>() { "help" }, // Subdomains
  62. new List<string>() { config.Host }, // domains
  63. "Mail", // URL with parameters
  64. new { controller = "Help", action = "Mail" }, // Parameter defaults
  65. new[] { typeof(Controllers.HelpController).Namespace }
  66. );
  67. context.MapSubdomainRoute(
  68. "Help.Mumble", // Route name
  69. new List<string>() { "help" }, // Subdomains
  70. new List<string>() { config.Host }, // domains
  71. "Mumble", // URL with parameters
  72. new { controller = "Help", action = "Mumble" }, // Parameter defaults
  73. new[] { typeof(Controllers.HelpController).Namespace }
  74. );
  75. context.MapSubdomainRoute(
  76. "Help.RSS", // Route name
  77. new List<string>() { "help" }, // Subdomains
  78. new List<string>() { config.Host }, // domains
  79. "RSS", // URL with parameters
  80. new { controller = "Help", action = "RSS" }, // Parameter defaults
  81. new[] { typeof(Controllers.HelpController).Namespace }
  82. );
  83. context.MapSubdomainRoute(
  84. "Help.Upload", // Route name
  85. new List<string>() { "help" }, // Subdomains
  86. new List<string>() { config.Host }, // domains
  87. "Upload", // URL with parameters
  88. new { controller = "Help", action = "Upload" }, // Parameter defaults
  89. new[] { typeof(Controllers.HelpController).Namespace }
  90. );
  91. context.MapSubdomainRoute(
  92. "Help.Markdown", // Route name
  93. new List<string>() { "help" }, // Subdomains
  94. new List<string>() { config.Host }, // domains
  95. "Markdown", // URL with parameters
  96. new { controller = "Help", action = "Markdown" }, // Parameter defaults
  97. new[] { typeof(Controllers.HelpController).Namespace }
  98. );
  99. // Register Style Bundles
  100. BundleTable.Bundles.Add(new StyleBundle("~/Content/help").Include(
  101. "~/Areas/Help/Content/Help.css"));
  102. }
  103. }
  104. }