Telerik® JustCode™ by Progress

The Introduce Constant refactoring allows you to quickly create a new constant field from a selected constant expression and initialize it with the expression.


Language Support

Supported: C#, VB.NET, JavaScript

Not relevant: ASP.NET, XAML, HTML

To introduce a constant

  1. Select an expression.

    Introduce Constant Selected
  2. Press Alt+Insert. From the pop-up menu, select Introduce Constant. All occurrences of this expression will be replaced with the generated constant.

  3. Enter a name for the new constant field or choose one of the suggested names.

    Introduce Constant Result
  4. Press Enter to finish or Esc to abort the operation.

To introduce a constant you can also navigate on the main menu. Choose JustCode | Refactor | Introduce Constant.


You can toggle name suggestions for a constant name from JustCode Options dialog.

See Also