Home > Code Providers > Generating the Switch/Select statement for enumeration variables

Generating the Switch/Select statement for enumeration variables

April 30th, 2012

CodeRush with Refactor! Pro provides a code provider that allows you to easily generate a switch (C#) or Select (VB) statement for all elements of the enumeration of the active identifier of the enumeration type. The Create Case Blocks from Enum code provider shows a part of the resulting code before applying it. It is possible to apply the code provider on a local variable or a parameter:

DevExpress Create Case Blocks from Enum provider preview

The resulting case statement contains a set of all elements of the enumeration type with markers on each case statement for easier navigation between cases to write the code inside of them:

DevExpress Create Case Blocks from Enum provider result

—–
Products: Refactor! Pro
Versions: 12.1 and up
VS IDEs: 2008 and up
Updated: Jul/19/2012
ID: R055

Similar Posts: