ManageNavPages.cs 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. #nullable disable
  4. using System;
  5. using Microsoft.AspNetCore.Mvc.Rendering;
  6. namespace Admin.Areas.Identity.Pages.Account.Manage;
  7. /// <summary>
  8. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  9. /// directly from your code. This API may change or be removed in future releases.
  10. /// </summary>
  11. public static class ManageNavPages
  12. {
  13. /// <summary>
  14. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  15. /// directly from your code. This API may change or be removed in future releases.
  16. /// </summary>
  17. public static string Index => "Index";
  18. /// <summary>
  19. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  20. /// directly from your code. This API may change or be removed in future releases.
  21. /// </summary>
  22. public static string Email => "Email";
  23. /// <summary>
  24. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  25. /// directly from your code. This API may change or be removed in future releases.
  26. /// </summary>
  27. public static string ChangePassword => "ChangePassword";
  28. /// <summary>
  29. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  30. /// directly from your code. This API may change or be removed in future releases.
  31. /// </summary>
  32. public static string DownloadPersonalData => "DownloadPersonalData";
  33. /// <summary>
  34. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  35. /// directly from your code. This API may change or be removed in future releases.
  36. /// </summary>
  37. public static string DeletePersonalData => "DeletePersonalData";
  38. /// <summary>
  39. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  40. /// directly from your code. This API may change or be removed in future releases.
  41. /// </summary>
  42. public static string ExternalLogins => "ExternalLogins";
  43. /// <summary>
  44. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  45. /// directly from your code. This API may change or be removed in future releases.
  46. /// </summary>
  47. public static string PersonalData => "PersonalData";
  48. /// <summary>
  49. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  50. /// directly from your code. This API may change or be removed in future releases.
  51. /// </summary>
  52. public static string TwoFactorAuthentication => "TwoFactorAuthentication";
  53. /// <summary>
  54. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  55. /// directly from your code. This API may change or be removed in future releases.
  56. /// </summary>
  57. public static string IndexNavClass(ViewContext viewContext) => PageNavClass(viewContext, Index);
  58. /// <summary>
  59. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  60. /// directly from your code. This API may change or be removed in future releases.
  61. /// </summary>
  62. public static string EmailNavClass(ViewContext viewContext) => PageNavClass(viewContext, Email);
  63. /// <summary>
  64. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  65. /// directly from your code. This API may change or be removed in future releases.
  66. /// </summary>
  67. public static string ChangePasswordNavClass(ViewContext viewContext) => PageNavClass(viewContext, ChangePassword);
  68. /// <summary>
  69. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  70. /// directly from your code. This API may change or be removed in future releases.
  71. /// </summary>
  72. public static string DownloadPersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, DownloadPersonalData);
  73. /// <summary>
  74. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  75. /// directly from your code. This API may change or be removed in future releases.
  76. /// </summary>
  77. public static string DeletePersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, DeletePersonalData);
  78. /// <summary>
  79. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  80. /// directly from your code. This API may change or be removed in future releases.
  81. /// </summary>
  82. public static string ExternalLoginsNavClass(ViewContext viewContext) => PageNavClass(viewContext, ExternalLogins);
  83. /// <summary>
  84. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  85. /// directly from your code. This API may change or be removed in future releases.
  86. /// </summary>
  87. public static string PersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, PersonalData);
  88. /// <summary>
  89. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  90. /// directly from your code. This API may change or be removed in future releases.
  91. /// </summary>
  92. public static string TwoFactorAuthenticationNavClass(ViewContext viewContext) => PageNavClass(viewContext, TwoFactorAuthentication);
  93. /// <summary>
  94. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  95. /// directly from your code. This API may change or be removed in future releases.
  96. /// </summary>
  97. public static string PageNavClass(ViewContext viewContext, string page)
  98. {
  99. var activePage = viewContext.ViewData["ActivePage"] as string
  100. ?? System.IO.Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
  101. return string.Equals(activePage, page, StringComparison.OrdinalIgnoreCase) ? "active" : null;
  102. }
  103. }