Click here to Skip to main content
15,921,622 members
Home / Discussions / C#
   

C#

 
GeneralRe: dynamic function call Pin
vatzcar17-Mar-06 19:47
vatzcar17-Mar-06 19:47 
QuestionCut/Copy/Paste for TreeView Pin
zaboboa17-Mar-06 5:08
zaboboa17-Mar-06 5:08 
AnswerRe: Cut/Copy/Paste for TreeView Pin
Ed.Poore17-Mar-06 12:52
Ed.Poore17-Mar-06 12:52 
QuestionHow to get the Enum item names using Reflection Pin
engsrini17-Mar-06 3:07
engsrini17-Mar-06 3:07 
AnswerRe: How to get the Enum item names using Reflection Pin
mcljava17-Mar-06 4:22
mcljava17-Mar-06 4:22 
QuestionRe: How to get the Enum item names using Reflection Pin
engsrini17-Mar-06 5:53
engsrini17-Mar-06 5:53 
AnswerRe: How to get the Enum item names using Reflection Pin
Guffa17-Mar-06 6:16
Guffa17-Mar-06 6:16 
QuestionRe: How to get the Enum item names using Reflection Pin
engsrini17-Mar-06 7:08
engsrini17-Mar-06 7:08 
If it is One Enum then your suggestions is OK. I can use Enum.GetNames(enum), But My situation is likes a structure which will contain lot of enums(say 100) as it member) so i can't write 100's lines of code to display every member

ie.
enum1<br />
{<br />
a=0,<br />
b,<br />
c<br />
}<br />
..<br />
enum100<br />
{<br />
x=0,<br />
y,<br />
z<br />
}<br />
<br />
Struct st<br />
{<br />
enum1 e1;<br />
enum2 e2;<br />
..<br />
enum100 e100;<br />
};<br />
<br />
Enum.GetNames(st.e1);<br />
..<br />
Enum.GetNames(st.e100);

Instead Puting like the above

I am thinking of reflection to reduce the line of code
Like this
Type ty = st.GetType();<br />
 FieldInfo[] fin= ty.GetFields();<br />
 foreach (FieldInfo fino in fin)<br />
  {<br />
   fino.GetValue(st).ToString();<br />
  }

But This print the enum1..enum100 values like 0 0 0 0 ..
but I want to print the enum member names like a b c ...

Hope I Explained my question Clearyly
Regards,
Srini
AnswerRe: How to get the Enum item names using Reflection Pin
Guffa17-Mar-06 7:32
Guffa17-Mar-06 7:32 
GeneralRe: How to get the Enum item names using Reflection Pin
engsrini17-Mar-06 8:32
engsrini17-Mar-06 8:32 
GeneralRe: How to get the Enum item names using Reflection Pin
Guffa17-Mar-06 8:34
Guffa17-Mar-06 8:34 
QuestionRe: How to get the Enum item names using Reflection Pin
engsrini17-Mar-06 8:41
engsrini17-Mar-06 8:41 
AnswerRe: How to get the Enum item names using Reflection Pin
engsrini17-Mar-06 8:44
engsrini17-Mar-06 8:44 
GeneralRe: How to get the Enum item names using Reflection Pin
Guffa17-Mar-06 8:54
Guffa17-Mar-06 8:54 
AnswerRe: How to get the Enum item names using Reflection Pin
chriswa17-Mar-06 13:26
chriswa17-Mar-06 13:26 
GeneralRe: How to get the Enum item names using Reflection Pin
engsrini20-Mar-06 1:42
engsrini20-Mar-06 1:42 
QuestionTime & Date Pin
deepscyberpulse17-Mar-06 2:43
deepscyberpulse17-Mar-06 2:43 
AnswerRe: Time & Date Pin
Sean Michael Murphy17-Mar-06 2:50
Sean Michael Murphy17-Mar-06 2:50 
AnswerRe: Time & Date Pin
sherwani17-Mar-06 2:51
sherwani17-Mar-06 2:51 
AnswerRe: Time & Date Pin
JuanAlbertoMD17-Mar-06 3:45
JuanAlbertoMD17-Mar-06 3:45 
QuestionNeed Help in c# Pin
mynameatif17-Mar-06 2:43
mynameatif17-Mar-06 2:43 
AnswerRe: Need Help in c# Pin
Judah Gabriel Himango17-Mar-06 9:08
sponsorJudah Gabriel Himango17-Mar-06 9:08 
GeneralRe: Need Help in c# Pin
Ed.Poore17-Mar-06 12:55
Ed.Poore17-Mar-06 12:55 
GeneralRe: Need Help in c# Pin
chriswa17-Mar-06 13:31
chriswa17-Mar-06 13:31 
GeneralRe: Need Help in c# Pin
Ed.Poore17-Mar-06 22:34
Ed.Poore17-Mar-06 22:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.