Often I am using a switch-case, and creating a case for all enum items.
Is there a shortcut (it may well be a resharper shortcut) which creates all cases automatically and just let me fill the cases?
Or is this question related to code-snippet subject? Is it possible to create a dynamic code-snippet (it will vary according to enum type) ?
Plain VS snippet will work for you ..write switch
and press "TAB", write your enum type and press enter(twice), the cases will be generated for you.
Set the cursor after the first brace within the switch statement and press Alt + Enter. You will see the option to generate switch labels.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With