Code Gen – Declare Struct
Declare Struct code provider generates a structure for the current type reference to a non-existent type. If the type reference on the editor caret creates a new instance of a non-existent type that takes some arguments, the appropriate constructor is generated for the new structure:
CSharp:
Result:
Visual Basic:
Result:
Otherwise, if there are no arguments passed, the default public parameterless constructor is declared:
CSharp:
Result:
Visual Basic:
Result:
A marker will be dropped after Declare Struct is performed at the source text caret position to easily get back and continue code editing:
Also, text fields will be created for the constructor parameters, if any, to easily rename them, according to your preference (see the sample above).
A similar code provider is Declare Class.
—– Products: CodeRush Pro and CodeRush Xpress Versions: 10.1 and up VS IDEs: any Updated: Nov/22/2010 ID: C033