The Create Constructor command lets you create a non-default constructor on-the-fly by just selecting the fields that you’d like the constructor to take as parameters.
Supported: C#, VB.NET
To Create a Constructor
Select the fields and properties that you like to include for initialization.
Press Alt+End. From the pop-up menu, select Create constructor
The result is:
Instead of selecting a field, you can just position the caret over it and then generate the constructor.
To create a constructor you can also navigate on the main menu. Choose JustCode | Code | Create Constructor, or just press Ctrl+R, Ctrl+C
To generate a constructor Telerik® JustCode™ follows these rules:
- All selected fields are included in the constructor as parameters with their corresponding names;
- Each field is initialized with the corresponding parameter.