Wiki

Case Status
Log In

Wiki

 
Whole Tomato Software - Home
  • RSS Feed

Add Missing Case Statements

When a switch on enum doesn't include all cases for the enum, Visual Assist can expand the switch to consider all values.

Move within a switch statement, not necessarily on the reserved word, and Add Missing Case Statements from the VA Context Menu or Quick Action and Refactoring menu (Shift+Alt+Q).

Visual Assist will expand the switch statement, even if it contains no cases. If cases exist, new ones will follow. A default case is added if one doesn't exist.

Fall Through

If existing cases exist yet the last would fall through to another case, it will fall into the first of missing case statements added. If you wish to prevent the fall through, you must prevent it manually.

Registry Settings

Value Name Meaning
AddMissingDefaultSwitchCase Prevent default when adding missing case statements