If I start with a function like
void DoStuffWith(System.Drawing.Imaging.PixelFormat value)
{
}
and want to different things depending on the value passed in, I might put my cursor on the blank line and type:
sw<tab><tab>val<enter><enter>
If I do this with CodeRush's switch templates disabled, I get this expansion:
switch (value)
{
case System.Drawing.Imaging.PixelFormat.Indexed:
break;
case System.Drawing.Imaging.PixelFormat.Gdi:
break;
case System.Drawing.Imaging.PixelFormat.Alpha:
break;
// … Eliding remaining enum values for brevity.
default:
break;
}
If I do this with CodeRush's switch code templates enabled, I get this expansion instead:
switch (value)
{
case 0:
break;
}
I see that CodeRush for Roslyn has three switch code templates, and one of them has an "HasEnum" tag in in. How do I get that template selected for enums?