|
1 | 1 | // Licensed to the .NET Foundation under one or more agreements.
|
2 | 2 | // The .NET Foundation licenses this file to you under the MIT license.
|
3 | 3 |
|
4 |
| -using System; |
5 | 4 | using Microsoft.AspNetCore.Mvc.Rendering;
|
6 | 5 |
|
7 | 6 | namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Manage.Internal
|
@@ -115,8 +114,67 @@ public static class ManageNavPages
|
115 | 114 | public static string PageNavClass(ViewContext viewContext, string page)
|
116 | 115 | {
|
117 | 116 | var activePage = viewContext.ViewData["ActivePage"] as string
|
118 |
| - ?? System.IO.Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); |
| 117 | + ?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); |
119 | 118 | return string.Equals(activePage, page, StringComparison.OrdinalIgnoreCase) ? "active" : null;
|
120 | 119 | }
|
| 120 | + |
| 121 | + /// <summary> |
| 122 | + /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used |
| 123 | + /// directly from your code. This API may change or be removed in future releases. |
| 124 | + /// </summary> |
| 125 | + public static string IndexAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, Index); |
| 126 | + |
| 127 | + /// <summary> |
| 128 | + /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used |
| 129 | + /// directly from your code. This API may change or be removed in future releases. |
| 130 | + /// </summary> |
| 131 | + public static string EmailAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, Email); |
| 132 | + |
| 133 | + /// <summary> |
| 134 | + /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used |
| 135 | + /// directly from your code. This API may change or be removed in future releases. |
| 136 | + /// </summary> |
| 137 | + public static string ChangePasswordAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, ChangePassword); |
| 138 | + |
| 139 | + /// <summary> |
| 140 | + /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used |
| 141 | + /// directly from your code. This API may change or be removed in future releases. |
| 142 | + /// </summary> |
| 143 | + public static string DownloadPersonalDataAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, DownloadPersonalData); |
| 144 | + |
| 145 | + /// <summary> |
| 146 | + /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used |
| 147 | + /// directly from your code. This API may change or be removed in future releases. |
| 148 | + /// </summary> |
| 149 | + public static string DeletePersonalDataAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, DeletePersonalData); |
| 150 | + |
| 151 | + /// <summary> |
| 152 | + /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used |
| 153 | + /// directly from your code. This API may change or be removed in future releases. |
| 154 | + /// </summary> |
| 155 | + public static string ExternalLoginsAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, ExternalLogins); |
| 156 | + |
| 157 | + /// <summary> |
| 158 | + /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used |
| 159 | + /// directly from your code. This API may change or be removed in future releases. |
| 160 | + /// </summary> |
| 161 | + public static string PersonalDataAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, PersonalData); |
| 162 | + |
| 163 | + /// <summary> |
| 164 | + /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used |
| 165 | + /// directly from your code. This API may change or be removed in future releases. |
| 166 | + /// </summary> |
| 167 | + public static string TwoFactorAuthenticationAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, TwoFactorAuthentication); |
| 168 | + |
| 169 | + /// <summary> |
| 170 | + /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used |
| 171 | + /// directly from your code. This API may change or be removed in future releases. |
| 172 | + /// </summary> |
| 173 | + public static string AriaCurrent(ViewContext viewContext, string page) |
| 174 | + { |
| 175 | + var activePage = viewContext.ViewData["ActivePage"] as string |
| 176 | + ?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); |
| 177 | + return string.Equals(activePage, page, StringComparison.OrdinalIgnoreCase) ? "page" : null; |
| 178 | + } |
121 | 179 | }
|
122 | 180 | }
|
0 commit comments