Smart Constructor

The Smart Constructor options page enables you to modify the Smart Constructor feature options.

opSmartConstructor

The options page includes the following options:

Allow me to select which fields to pass to this constructor

Specifies conditions when CodeRush Classic suggests fields that should be initialized in the constructor with values passed as parameters. The available values include: Always, When field count is greater than N, and Never (automatically pass and initialize all fields in the constructor).

 

Initialize unselected fields and properties

Specifies whether CodeRush Classic initializes unselected fields with default values (or values listed in the Type Initializers options page), or ignores unselected fields. If the previous option (Allow me to select which fields to pass to this constructor) is set to Never, the Initialize unselected fields and properties option is disabled.

 

Sort mode in the field selector

Specifies the sort order of fields in the field selector window. The available values include By declaration position, By name and By type.

 

Generate XML documentation stubs

Specifies whether or not the Smart Constructor generates XML documentation comments for the constructor. If this option is enabled, you can specify the default summary description via the Default summary description text box.

 

Generate default constructor for serializable classes

If this option is enabled, CodeRush Classic generates the default serializable class constructor (containing parameters of the SerializationInfo and StreamingContext types) in addition to the custom constructor if the current class has the Serializable attribute.

 

Generate read-only properties for selected fields

If this option is enabled, CodeRush Classic generates read-only properties for selected fields.

 

Generate public field initializers from the base type

Specifies whether or not the Smart Constructor initializes the base class fields and properties visible within the current class in addition to the current class fields and properties.

Note

This product is designed for outdated versions of Visual Studio. Although Visual Studio 2015 is supported, consider using the CodeRush extension with Visual Studio 2015 or higher.