|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Getting description attribute value from value typeSay I have an enumeration
Public Enum MyEnum <desctription("test 123") Test <description("My Val") Value end enum private MyValue as MyEnum = MyEnum.Text now I want to get the description in code, i'm assumeing reflection, but exactly how would I get that information about the description of the value in MyValue? thanks! Smokey Grindle wrote:
> Say I have an enumeration Real code please.> > Public Enum MyEnum > <desctription("test 123") Test > <description("My Val") Value > end enum -- Larry Lard larryl***@googlemail.com The address is real, but unread - please reply to the group For VB and C# questions - tell us which version there is no "Real code" I'm just asking how do you access a value of an
attribute for an item.... Show quoteHide quote "Larry Lard" <larryl***@googlemail.com> wrote in message news:4km4nqFct7k9U1@individual.net... > Smokey Grindle wrote: >> Say I have an enumeration >> >> Public Enum MyEnum >> <desctription("test 123") Test >> <description("My Val") Value >> end enum > > Real code please. > > > -- > Larry Lard > larryl***@googlemail.com > The address is real, but unread - please reply to the group > For VB and C# questions - tell us which version "Smokey Grindle" <nospam@dontspamme.com> schrieb: Adding descriptions to enumeration constants> Public Enum MyEnum > <desctription("test 123") Test > <description("My Val") Value > end enum > > private MyValue as MyEnum = MyEnum.Text > > now I want to get the description in code, i'm assumeing reflection, but > exactly how would I get that information about the description of the > value in MyValue? <URL:http://dotnet.mvps.org/dotnet/faqs/?id=enumdescription&lang=en> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> thanks, that is exactly what I was looking for!
Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:OSr$d$uwGHA.1296@TK2MSFTNGP02.phx.gbl... > "Smokey Grindle" <nospam@dontspamme.com> schrieb: >> Public Enum MyEnum >> <desctription("test 123") Test >> <description("My Val") Value >> end enum >> >> private MyValue as MyEnum = MyEnum.Text >> >> now I want to get the description in code, i'm assumeing reflection, but >> exactly how would I get that information about the description of the >> value in MyValue? > > Adding descriptions to enumeration constants > <URL:http://dotnet.mvps.org/dotnet/faqs/?id=enumdescription&lang=en> > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
VB Net and ADOX
DateTime conversion to Integer Detecting if a printer is connected to the PC Component UI CAB Architecture Guide??? For Dummies Book? :-) SqlDataAdapter.FillSchema Redrawing a part of a control What to do when GetDeviceCaps doesn't? VB 2005 Visual Styles problem Datagrid relationships Math question: Based on excel |
|||||||||||||||||||||||