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.5KB

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