473,396 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Getting description attribute value from value type

Say 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!
Aug 18 '06 #1
4 1414
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
la*******@googlemail.com
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version
Aug 18 '06 #2
there is no "Real code" I'm just asking how do you access a value of an
attribute for an item....

"Larry Lard" <la*******@googlemail.comwrote in message
news:4k************@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
la*******@googlemail.com
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version

Aug 18 '06 #3
"Smokey Grindle" <no****@dontspamme.comschrieb:
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/>

Aug 18 '06 #4
thanks, that is exactly what I was looking for!

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:OS**************@TK2MSFTNGP02.phx.gbl...
"Smokey Grindle" <no****@dontspamme.comschrieb:
>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/>

Aug 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: ???????J | last post by:
Javascript may inquire the push down menu value, can I inquire the description? The following example, the variable($answer) can be get the menu1's value. For example, if I select first data,...
5
by: Don | last post by:
Hi: I have created an xsd from my xml document. I pop this xsd in the following directory: C:\program files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml. That give me...
6
by: Michael | last post by:
Hi All, I need a few suggestions. I have the following XML segment: <LookUp> <ControlType>CheckBoxGroup</ControlType> <DBField>LastMedDate</DBField> <ControlName>cmbGoal1</ControlName> <Values...
8
by: doomx | last post by:
I'm using SQL scripts to create and alter tables in my DB I want to know if it's possible to fill the description(like in the Create table UI) using these scripts. EX: CREATE TABLE(...
1
by: Paul J. Lucas | last post by:
I have code that builds a DOM using the Java org.w3c.dom API and it adds an extra attribute to one of the elements that I don't want. Not only that, the value it adds is wrong. The code to...
0
by: rautsmita | last post by:
hello friends , i am using to jdk6 and JAXB2.0, i have geomtry.xsd file i am trying to compile this file using jaxb but i got some error i.e.The particle of the type is not a valid restriction of...
0
by: buntyindia | last post by:
Hi, I have a very strange problem with my application. I have developed it using Struts. I have a TextBox With Some fixed value in it and on Submit iam passing it to another page. <html:form...
8
by: ismailc | last post by:
Hi, I would like to change the text color of (<xsl:value-of select="Description") onmouseover of image. the javascript works, it's just that i can seem to get the name correct <td>...
1
AaronL
by: AaronL | last post by:
Hello, First I would like to say thank you all for your help in the past. I am stumped again. I am creating an e-commerce system and I want to be able to upload images to the server and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.