quick enum value help

Hello,

is there any quick way for retrieving the enum values (=numbers) of an enum
type or an specific enum member? (Both for external and for own code?)

--
/\/\arkus.

3 comments

I'm not sure if you're asking something R#-specifc. If you want the (say, int) values of an enum type, use:

var myVals = Enum.GetValues(typeof(MyEnum)).Cast<int>();

If you want the value of a particular name, use:

var myVal = (int)MyEnum.MyName;

0

David,

I'm not sure if you're asking something R#-specifc.


I wrote I want "quick" help inside VS without executing some command line
code.
For example when pressing CtrlShiftF1 (a R# feature) it couldn't be hard
to show the real enum value there, too.

--
/\/\arkus.

0

Hello Markus,

If I'm right, there's a similar feature request in our tracker: http://youtrack.jetbrains.net/issue/RSRP-97300
which hasn't been implemented yet. You're welcome to vote for it. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

David,

>> I'm not sure if you're asking something R#-specifc.
>>

I wrote I want "quick" help inside VS without executing some command
line
code.
For example when pressing CtrlShiftF1 (a R# feature) it couldn't be
hard
to show the real enum value there, too.



0

Please sign in to leave a comment.