-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataGrid: Added using title of enum for filter #7621 #8581
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #8581 +/- ##
==========================================
- Coverage 89.82% 89.77% -0.06%
==========================================
Files 412 411 -1
Lines 11878 11828 -50
Branches 2364 2363 -1
==========================================
- Hits 10670 10618 -52
- Misses 681 682 +1
- Partials 527 528 +1 ☔ View full report in Codecov by Sentry. |
It should probably fallback so you don't need both attributes on the enum, like for example: /// <summary>
/// Returns the best display name for the given type.
/// </summary>
/// <param name="shortName">Try to find the shorter version of the name</param>
public static string GetDisplayName(this Type type, bool shortName = false) =>
(shortName ? type?.GetCustomAttribute<DisplayAttribute>()?.ShortName : null) ??
type?.GetCustomAttribute<DisplayAttribute>()?.Name ??
type?.GetCustomAttribute<DisplayNameAttribute>()?.DisplayName ??
type?.GetCustomAttribute<DescriptionAttribute>()?.Description ??
type?.Name; But Isn't there a source generator for this or something? @ScarletKuro |
The source generator is only working with the I do not understand why I'm also not sure if this is fixing localization issues, what if you want multi-languages for the enum? I will let @tjscience and maybe @mikes-gh (if he is interested) to review this instead. |
Description
Fix: #7621 , #5766
Using name of enum in filter of DataGrid by Display attribute, for example:
if attribute non exists, will be returns default value of enum
Added
How Has This Been Tested?
Compiled and test in my project
Types of changes
Checklist:
dev
).