Enum Description


/ Published in: VB.NET
Save to your folder(s)

<p>Returns the description set in an enum value, or if no description is found it returns the name of the enum value. Use this without worrying about passing the enum type, you should only pass the enum value</p>

<p>Example</p>

<pre><code>Friend Enum Duration
&lt;Description("Every 12 Months")&gt; Year = 1
&lt;Description("Every 6 Months")&gt; Semester = 2
End Enum

GetEnumDescription(Duration.Year) returns "Every 12 Months"
</code></pre>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.