tags:

views:

723

answers:

3
A: 

as far as i know you cant, Resharper comes with predefined styles, but maybe if you create your own live template and set it the way you want it will works.

hope this helps.

it seems you really can't....live template does something else though, has no effect on code formatting.
Hadi Eskandari
+1  A: 

This article seems to have an answer similar to what you're looking for:

ReSharper: Fixing array and object initializer indentation

Alex Beynenson
Thanks for mentioning the article :)
hmemcpy
+30  A: 

You can customize ReSharper to do just that, you'll need to do the following (All in ReSharper -> Options -> C# -> Formatting Style):

  1. In Braces Layout, set Array and object initializer to At Next line (BSD Style).
  2. In Other, make sure that Continuous line indent multiplier is set to 1.
  3. In Other, make sure that Indent array, object and collection initializer block is unchecked.

You should get the style you want.

hmemcpy
+1 you are right - 3. is the important step
tanascius
Too bad someone can't mark this as the correct answer because it obviously is.
jeremcc
No, this isn't a solution. This setting doesn't put the first brace on the next line.
brianary
This needs a step 4: In ''Other'', make sure that 'Indent array, object and collection initializer block' is ''unchecked''.
brianary
this worked perfectly for me; this has always bugged me so your answer is very much appreciated, thanks
INinjaAndy