Telerik® JustCode™ by Progress

The To Object Initializer refactoring allows you to quickly convert assignment statements to an object initializer by adding them to the constructor.


Language Support

Supported: C#, VB.NET

Not relevant: ASP.NET, XAML, HTML, JavaScript

To Object Initializer

  1. Put the cursor over the name of the object or over the constructor.

    To Object Initializer
  2. Press Alt+Insert. From the pop-up menu, select To Object Initializer.

    To Object Initializer Before
  3. The result is :

    To Object Initializer After

To convert to object initializer you can also navigate on the main menu. Choose JustCode | Refactor | To Object Initializer.

See Also