The Introduce Constant refactoring allows you to quickly create a new constant field from a selected constant expression and initialize it with the expression.
Not relevant: ASP.NET, XAML, HTML
To introduce a constant
Select an expression.
Press Alt+Insert. From the pop-up menu, select Introduce Constant. All occurrences of this expression will be replaced with the generated constant.
Enter a name for the new constant field or choose one of the suggested names.
- 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.