Braces layout for object initializers

Is it possible to configure ReSharper to use the following braces layout for array/object initializers:

int[] array = new int[]
{
    1, 2, 3
}



var myObject = new XY
{
    Property1 = "abc",
    Property2 = 4432

}

I.e: braces on new line, but not indented. Content (property setters / array values) indented by one tab.

2 comments

Hello,

Try turning off the 'Indent array/object/collection initializer' option under
ReSharper | Options | Languages | C# | Code Style | Other. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Is it possible to configure ReSharper to use the following braces
layout for array/object initializers:

int[] array = new int[]
{
1, 2, 3
}
var myObject = new XY
{
Property1 = "abc",
Property2 = 4432
}

I.e: braces on new line, but not indented. Content (property setters /
array values) indented by one tab.

---
Original message URL:
http://devnet.jetbrains.net/message/5308230#5308230



0

Thanks that did the trick!
Also: the setting "C# / Formatting Style / Braces Layout / Array and object initializer" has to be set to "At next line (BSD style)".

0

Please sign in to leave a comment.