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.

PasteAreaRegistration.cs 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using System.Web.Optimization;
  4. namespace Teknik.Areas.Paste
  5. {
  6. public class PasteAreaRegistration : AreaRegistration
  7. {
  8. public override string AreaName
  9. {
  10. get
  11. {
  12. return "Paste";
  13. }
  14. }
  15. public override void RegisterArea(AreaRegistrationContext context)
  16. {
  17. context.MapSubdomainRoute(
  18. "Paste.Index", // Route name
  19. new List<string>() { "dev", "paste", "p" },
  20. "", // URL with parameters
  21. new { controller = "Paste", action = "Index" }, // Parameter defaults
  22. new[] { typeof(Controllers.PasteController).Namespace }
  23. );
  24. context.MapSubdomainRoute(
  25. "Paste.View", // Route name
  26. new List<string>() { "dev", "paste", "p" },
  27. "{id}", // URL with parameters
  28. new { controller = "Paste", action = "View" }, // Parameter defaults
  29. new[] { typeof(Controllers.PasteController).Namespace }
  30. );
  31. context.MapSubdomainRoute(
  32. "Paste.Simple", // Route name
  33. new List<string>() { "dev", "paste", "p" },
  34. "Simple/{id}", // URL with parameters
  35. new { controller = "Paste", action = "Simple" }, // Parameter defaults
  36. new[] { typeof(Controllers.PasteController).Namespace }
  37. );
  38. context.MapSubdomainRoute(
  39. "Paste.Raw", // Route name
  40. new List<string>() { "dev", "paste", "p" },
  41. "Raw/{id}", // URL with parameters
  42. new { controller = "Paste", action = "Raw" }, // Parameter defaults
  43. new[] { typeof(Controllers.PasteController).Namespace }
  44. );
  45. context.MapSubdomainRoute(
  46. "Paste.Action", // Route name
  47. new List<string>() { "dev", "paste", "p" },
  48. "Action/{action}", // URL with parameters
  49. new { controller = "Paste", action = "Paste" }, // Parameter defaults
  50. new[] { typeof(Controllers.PasteController).Namespace }
  51. );
  52. // Register Script Bundles
  53. BundleTable.Bundles.Add(new ScriptBundle("~/bundles/paste").Include(
  54. "~/Scripts/Highlight/highlight.pack.js",
  55. "~/Areas/Paste/Scripts/Paste.js"));
  56. // Register Style Bundles
  57. BundleTable.Bundles.Add(new StyleBundle("~/Content/paste").Include(
  58. "~/Content/Highlight/default.css"));
  59. }
  60. }
  61. }