Ticket S132862
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

CodeGen - Add options to specify code generation rules

object initializer members on new line

created 16 years ago

"Convert to initializer" refactoring puts all member assignments on one line making the code harder to read when there are a lot of properties.
Proposed Solution:
Provide a user defined threshold setting above which member assignments are each done on a new line, this would make object initialisers with a lot of member assignments easier to read.
original code:
var foo = new bar();
foo.A = 0;
foo.B = 1;
foo.C = 2;
with threshold = 4:
var foo = new bar { A = 0, B = 1, C = 2 }; //as it is currently implemented
with threshold = 3:
var foo = new bar
{
   A = 0,
   B = 1,
   C = 2
};

Comments (1)
DevExpress Support Team 16 years ago

    Hi Eamon,
    Thank you for the suggestion.
    A more general feature request is already registered in our database:
    ID: S19229, CodeGen - Add options to specify code generation rules
    So, I've marked this suggestion as its duplicate, and we'll consider implementing the functionality you suggested in the context of this suggestion. I've added the corresponding note to this item.
    Thanks,
    Vito

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.