ReSharper: formatting delegates

I like my code formatted as follows:

WithDataContext.Execute( delegate(DataContext dataContext) { // code goes here. }); 

ReSharper wants to automatically format it as follows:

 WithDataContext.Execute( delegate(DataContext dataContext) { // code goes here. }); 

What parameters do I need to configure in order to get what I want?

+7
resharper
source share
2 answers

ReSharper -> Options -> C # -> Formatting Style -> Brackets Format -> Anonymous Method Declaration

Set to "On the next line (BSD style)"

ReSharper -> Options -> C # -> Formatting Style -> Other -> Align Multiline Constructs

Uncheck the “Call arguments” box and you’ll get what you are looking for.

+10
source share

It is not possible to format such a format that I can find, but take a look at ReSharper | Options: Languages ​​| C # | Formatting Style | Braces Layout. It has a number of options, such as an anonymous type format.

+2
source share

All Articles