Repository navigation
Enum Helper Methods - #1
Conversation
|
Looking good, thanks Tom! Before I merge it in, just thinking (again) about the namespace/location. We do have the "Shared" area in the @Hendy - any feedback? |
|
Nice one Tom :) yes, Shared/Helpers looks to be a sensible place. |
* Remove now unused variables in favor of EnumHelper * Remove now unneeded using statements * Update method comments
|
@leekelleher Better late than never? ;) All set and moved to |
|
I'm merging in the pull-request now, good work! 👍 Although I'm not sure I like |
|
@leekelleher Yeah, I was thinking about that. There could be a potential use case for having I'm thinking that a DataType bundling an That's exactly what we're doing here, but maybe there's some confusion on whether Enums are a uComponents/Core concern or are part of the Enum datatypes. Normally I'd say the latter, but we're in a unique situation since there's 3 datatypes that rely on it. HMM! If we do consider them a core concern, I agree that it makes sense to remove that dependency and move the class. Glad to do that for you if you like. Just thinking out loud, but maybe DataTypes that wish to provide XsltExtensions should define them in their own namespace, and |
|
Thanks Tom, all good (and valid) points! Okay, let's leave |
This is for workitem 14779
This extracts the code used by
EnumCheckBoxListandEnumDropDownListinto a helper method so that others can easily reuse the values specified in the Enum's custom attributes. For example, if you want to output the values on the website front-end.I chose to return
ListItemsince the properties in the attribute already match perfectly - might need to be changed in the future, though, if properties are added.I'll update the documentation with these new methods once they're finalized.
Syntax
Razor / C#
XSLT
Issues
uComponents.Coreprobably isn't the best place for this. Ideally it would live in theDataTypesproject, but I couldn't find a good place to put it since it applies to both theEnumCheckBoxListandEnumDropDownListdatatypes.GetEnumListAttributeValues? 😬