ReSharper: formatting of delegates
I like my code formatted like this:
WithDataContext.Execute(
delegate(开发者_JAVA百科DataContext dataContext)
{
// code goes here.
});
ReSharper wants to auto-format it like this:
WithDataContext.Execute(
delegate(DataContext dataContext)
{
// code goes here.
});
What options do I need to tweak to get what I want?
ReSharper -> Options -> C# -> Formatting Style -> Braces Layout -> Anonymous method declaration
Set to "At next line (BSD style)"
ReSharper -> Options -> C# -> Formatting Style -> Other -> Align Multiline Constructs
Uncheck "Call Arguments" and you'll get what you're looking for.
There isn't an option to format quite like that that I can find, but take a look at ReSharper|Options: Languages|C#|Formatting Style|Braces Layout. It has a number of options like anonymous type format.
精彩评论