Comparing enums?
-
use the typeof(ur enum) with compare() method
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
-
use the typeof(ur enum) with compare() method
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
How would that work, exactly ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
How would that work, exactly ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Good question i have put small exmaple here public enum Named : int { A, B, C, D } public enum Names : byte { A, B, C, D } check if (Enum.Equals(typeof(Named),typeof(Names))) { //type is equal } thanks you
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
-
Good question i have put small exmaple here public enum Named : int { A, B, C, D } public enum Names : byte { A, B, C, D } check if (Enum.Equals(typeof(Named),typeof(Names))) { //type is equal } thanks you
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
OK - so does that compare based on enum name, or their intrinsic int value ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
OK - so does that compare based on enum name, or their intrinsic int value ?
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
I seen your profile,your are MVP in code project, Are you checking me? :-D Basically Compare based on the type of the enum You can understand from my example. Thank you
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
-
I seen your profile,your are MVP in code project, Are you checking me? :-D Basically Compare based on the type of the enum You can understand from my example. Thank you
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
No, I've never seen this before, I would think that comparing two different enums is a bad design, I'm curious how it would work.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
No, I've never seen this before, I would think that comparing two different enums is a bad design, I'm curious how it would work.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
So is it wrong? or is it can't be exist like that?
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
-
So is it wrong? or is it can't be exist like that?
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
I am saying I've never used it, I was curious how it works, although I'd never use it, personally.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I am saying I've never used it, I was curious how it works, although I'd never use it, personally.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Thank you.
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
-
Good question i have put small exmaple here public enum Named : int { A, B, C, D } public enum Names : byte { A, B, C, D } check if (Enum.Equals(typeof(Named),typeof(Names))) { //type is equal } thanks you
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
You're trying to compare the types to each other. The enum Equals takes two enum values.
-
You're trying to compare the types to each other. The enum Equals takes two enum values.