tag:blogger.com,1999:blog-2142045185830331206.post8543777292637716222..comments2023-01-27T04:07:27.729-08:00Comments on Decoding Code: A [Description] Attribute approach for enums in TypescriptAchilleshttp://www.blogger.com/profile/12853645149392259369noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-2142045185830331206.post-76570796189301248392018-01-04T20:27:44.646-08:002018-01-04T20:27:44.646-08:00greatgreatfor ict 99https://www.blogger.com/profile/01234222908168002434noreply@blogger.comtag:blogger.com,1999:blog-2142045185830331206.post-38861345461403563502017-04-02T21:11:51.641-07:002017-04-02T21:11:51.641-07:00would it not just be easier to have a separate arr...would it not just be easier to have a separate array of strings, using the enum values as a key?<br />searchOptionDescription[SearchOption.startingWith] = 'Starting with';<br />then the description can be accessed with<br />var q = searchOptionDescription[thesearchOptionSelected];.\\axxxhttps://www.blogger.com/profile/11785414672224688375noreply@blogger.comtag:blogger.com,1999:blog-2142045185830331206.post-1582584924396275582016-12-06T13:19:36.103-08:002016-12-06T13:19:36.103-08:00What you see in this post is all client-side code....What you see in this post is all client-side code. You would be needing the help of a webservice to deliver the enum values coming from your C# code to the client, then you could use those values to populate the enum instead of hard-coding it.Achilleshttps://www.blogger.com/profile/12853645149392259369noreply@blogger.comtag:blogger.com,1999:blog-2142045185830331206.post-63157359984650137592016-12-06T08:02:57.734-08:002016-12-06T08:02:57.734-08:00Is there any way to automate your descriptions tha...Is there any way to automate your descriptions that you have defined: StartingWithDescription = "Starting With" getting this from the C# enumeration itself ? and not redefining it - if your enum in C# changes - then you need to edit this as well - I am looking at one stop shop any ideas on how to do that ?<br /> stixhttps://www.blogger.com/profile/12139802254056335247noreply@blogger.com