Skip to content
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

EnumHumanizeExtensions.GetCustomDescription doesn't retrieve descendants of DescriptionAttribute #97

Closed
JeremyThomas opened this issue Mar 4, 2014 · 2 comments · Fixed by #108

Comments

@JeremyThomas
Copy link

If an enum is annotated with a descendants of DescriptionAttribute that annotation doesn't get honoured by EnumHumanizeExtensions.Humanize, IOW, it gets ignored.

Example of a DescriptionAttribute descendant:
http://www.codeproject.com/Articles/29495/Binding-and-Using-Friendly-Enums-in-WPF

@MehdiK
Copy link
Member

MehdiK commented Mar 4, 2014

Ah yeah. To make it work with PCL I had to do some reflection hack (there is no DescriptionAttribute in PCL). Will have to fix that.

Thanks for reporting.

@MehdiK
Copy link
Member

MehdiK commented Mar 26, 2014

The fix is now released to NuGet as v1.14.1. Basically ANY attribute on an enum member with a string Description property is honored. This way you can use a subclass of DescriptionAttribute or create a completely custom attribute with a public Description property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants