Click here to Skip to main content
12,448,343 members (53,089 online)
   

C#

 
QuestionC# progam call second C# program Pin
dcof10-Oct-12 16:04
memberdcof10-Oct-12 16:04 
AnswerRe: C# progam call second C# program Pin
Richard MacCutchan10-Oct-12 21:48
mvpRichard MacCutchan10-Oct-12 21:48 
AnswerRe: C# progam call second C# program Pin
Pete O'Hanlon10-Oct-12 22:21
protectorPete O'Hanlon10-Oct-12 22:21 
QuestionCitrix Session Pin
Arun Philip Reynolds10-Oct-12 8:30
memberArun Philip Reynolds10-Oct-12 8:30 
AnswerRe: Citrix Session Pin
Eddy Vluggen10-Oct-12 23:57
memberEddy Vluggen10-Oct-12 23:57 
QuestionEnumerate through the values of a enum Pin
Sentenryu10-Oct-12 7:38
memberSentenryu10-Oct-12 7:38 
AnswerRe: Enumerate through the values of a enum Pin
Dave Kreskowiak10-Oct-12 8:01
mvpDave Kreskowiak10-Oct-12 8:01 
GeneralRe: Enumerate through the values of a enum Pin
Sentenryu10-Oct-12 8:18
memberSentenryu10-Oct-12 8:18 
and the only way to do this and maintain the type of the enum is adding the values manually to the list...

I was thinking of someway to call a method with every possibly constant of a enum, but the only thing i got so far is something like:

foreach(int value in Enum.GetValues(typeof(MyEnum))){
    MyEnum e = (MyEnum)value;
    ...
}

or if you prefer the linq way...

((IEnumerable<int>)Enum.GetValues(typeof(MyEnum))).Select(x => (MyEnum)x);

the only thing i don't understand is why i can't call the Select method directly on the return of Enum.GetValues(), maybe because Array implements the non-generic IEnumerable interface?
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)

GeneralRe: Enumerate through the values of a enum Pin
Dave Kreskowiak10-Oct-12 8:29
mvpDave Kreskowiak10-Oct-12 8:29 
GeneralRe: Enumerate through the values of a enum Pin
Sentenryu10-Oct-12 8:55
memberSentenryu10-Oct-12 8:55 
GeneralRe: Enumerate through the values of a enum Pin
Mr. Tapan Kumar10-Oct-12 9:47
memberMr. Tapan Kumar10-Oct-12 9:47 
GeneralRe: Enumerate through the values of a enum Pin
J4amieC10-Oct-12 21:26
memberJ4amieC10-Oct-12 21:26 
GeneralRe: Enumerate through the values of a enum Pin
J4amieC10-Oct-12 21:25
memberJ4amieC10-Oct-12 21:25 
GeneralRe: Enumerate through the values of a enum Pin
Dave Kreskowiak10-Oct-12 23:52
mvpDave Kreskowiak10-Oct-12 23:52 
AnswerRe: Enumerate through the values of a enum Pin
J4amieC10-Oct-12 21:20
memberJ4amieC10-Oct-12 21:20 
GeneralRe: Enumerate through the values of a enum Pin
Sentenryu11-Oct-12 0:07
memberSentenryu11-Oct-12 0:07 
QuestionProviderUserKey error Pin
saiprakash031510-Oct-12 6:15
membersaiprakash031510-Oct-12 6:15 
AnswerRe: ProviderUserKey error Pin
OriginalGriff10-Oct-12 8:36
mvpOriginalGriff10-Oct-12 8:36 
GeneralRe: ProviderUserKey error Pin
saiprakash031510-Oct-12 14:14
membersaiprakash031510-Oct-12 14:14 
QuestionC# Pin
Jaleel Ahmed10-Oct-12 6:11
memberJaleel Ahmed10-Oct-12 6:11 
AnswerRe: C# Pin
Paul Conrad10-Oct-12 7:31
memberPaul Conrad10-Oct-12 7:31 
AnswerRe: C# Pin
Abhinav S10-Oct-12 16:08
mvpAbhinav S10-Oct-12 16:08 
AnswerRe: C# Pin
KiranKumar Roy14-Oct-12 1:36
memberKiranKumar Roy14-Oct-12 1:36 
QuestionProgressive tax calculator in C# Pin
cyberhopper10-Oct-12 2:26
membercyberhopper10-Oct-12 2:26 
AnswerRe: Progressive tax calculator in C# Pin
Pete O'Hanlon10-Oct-12 3:05
protectorPete O'Hanlon10-Oct-12 3:05 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 25 Aug 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid