Select Case / Switch Assistant for Enums

Top  Previous  Next

The Select Case / Switch Assistant for Enums feature allows you to quickly create the block of Case statements for an enum expression.

MZ-Tools offers the following ways to show the Select Case / Switch Assistant:

  • The MZ-Tools | Select Case / Switch Assistant for Enums... menu.
  • The MZ-Tools | Select Case / Switch Assistant for Enums... context menu of a code window.
  • The Select Case / Switch Assistant for Enums button on the MZ-Tools toolbar.
  • The keyboard shortcut associated with the MZTools6_VSXXXX.SelectCaseOrSwitchAssistant command.

When you type a statement such as:

[C#]

 

switch (objColumnHeader.TextAlign)

[VB.NET]

 

Select Case objColumnHeader.TextAlign

and you invoke this assistant the following window is shown:

SelectCaseAssistant

In this window, you can choose the values of the enum expression which require a separate Case statement. If you leave enum values not selected, a default (C#) or Case Else (VB.NET) statement is added.

You can also select if you want to use full names for the enum values or not.

Remarks:

  • There are some limitations to the expressions that MZ-Tools can resolve in order to get the returned type.
  • This feature is not available for the C++ language.

See Also:

Keyboard Shortcuts Options