ManageNavPages.cs 6.7 KB

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