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.

VaultAreaRegistration.cs 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.Vault
  7. {
  8. public class VaultAreaRegistration : AreaRegistration
  9. {
  10. public override string AreaName
  11. {
  12. get
  13. {
  14. return "Vault";
  15. }
  16. }
  17. public override void RegisterArea(AreaRegistrationContext context)
  18. {
  19. Config config = Config.Load();
  20. context.MapSubdomainRoute(
  21. "Vault.Index",
  22. new List<string>() { "vault", "v" }, // Subdomains
  23. new List<string>() { config.Host }, // domains
  24. "",
  25. new { controller = "Vault", action = "NewVault" },
  26. new[] { typeof(Controllers.VaultController).Namespace }
  27. );
  28. context.MapSubdomainRoute(
  29. "Vault.NewVault",
  30. new List<string>() { "vault", "v" }, // Subdomains
  31. new List<string>() { config.Host }, // domains
  32. "Create",
  33. new { controller = "Vault", action = "NewVault" },
  34. new[] { typeof(Controllers.VaultController).Namespace }
  35. );
  36. context.MapSubdomainRoute(
  37. "Vault.NewVaultFromService",
  38. new List<string>() { "vault", "v" }, // Subdomains
  39. new List<string>() { config.Host }, // domains
  40. "Create/{type}",
  41. new { controller = "Vault", action = "NewVaultFromService" },
  42. new[] { typeof(Controllers.VaultController).Namespace }
  43. );
  44. context.MapSubdomainRoute(
  45. "Vault.EditVault",
  46. new List<string>() { "vault", "v" }, // Subdomains
  47. new List<string>() { config.Host }, // domains
  48. "Edit/{url}",
  49. new { controller = "Vault", action = "EditVault" },
  50. new[] { typeof(Controllers.VaultController).Namespace }
  51. );
  52. context.MapSubdomainRoute(
  53. "Vault.DeleteVault",
  54. new List<string>() { "vault", "v" }, // Subdomains
  55. new List<string>() { config.Host }, // domains
  56. "Delete",
  57. new { controller = "Vault", action = "DeleteVault" },
  58. new[] { typeof(Controllers.VaultController).Namespace }
  59. );
  60. context.MapSubdomainRoute(
  61. "Vault.ViewVault",
  62. new List<string>() { "vault", "v" }, // Subdomains
  63. new List<string>() { config.Host }, // domains
  64. "v/{id}",
  65. new { controller = "Vault", action = "ViewVault" },
  66. new[] { typeof(Controllers.VaultController).Namespace }
  67. );
  68. context.MapSubdomainRoute(
  69. "Vault.Action",
  70. new List<string>() { "vault", "v" }, // Subdomains
  71. new List<string>() { config.Host }, // domains
  72. "Action/{controller}/{action}",
  73. new { controller = "Vault", action = "NewVault" },
  74. new[] { typeof(Controllers.VaultController).Namespace }
  75. );
  76. // Register style bundles
  77. BundleTable.Bundles.Add(new CdnStyleBundle("~/Content/vault", config.CdnHost).Include(
  78. "~/Areas/Vault/Content/Vault.css"));
  79. // Register Script Bundle
  80. BundleTable.Bundles.Add(new CdnScriptBundle("~/bundles/vault", config.CdnHost).Include(
  81. "~/Scripts/jquery.blockUI.js",
  82. "~/Scripts/bootbox/bootbox.min.js",
  83. "~/Areas/Vault/Scripts/Vault.js"));
  84. }
  85. }
  86. }