This Question is Answered

2 "helpful" answers available (2 pts)
2 Replies Last post: Jun 25, 2012 3:49 PM by bitbonk  
bitbonk Newbie 20 posts since
Feb 1, 2010
Currently Being Moderated

Jun 25, 2012 12:47 PM

brace layout without indentation

For anonymous types and anonymous delegates, is it possible to get rid of the line indentation? So when autoformatting, instead of this

 

this.container = new Container(x =>
                                   {
                                       x.For<IShell>().Use<ShellViewModel>();
                                       x.Scan(r =>
                                                  {
                                                      r.AssemblyContainingType<IEventAggregator>();
                                                      r.WithDefaultConventions();
                                                      r.TheCallingAssembly();
                                                  });
                                   });

 

I'd would like to get this:

 

this.container = new Container(x =>
{
    x.For<IShell>().Use<ShellViewModel>();
    x.Scan(r =>
    {
        r.AssemblyContainingType<IEventAggregator>();
        r.WithDefaultConventions();
        r.TheCallingAssembly();
    });
});

 

Again, it should also work like this for anonymous types.

Andrey Serebryansky JetBrains 2,900 posts since
Jan 12, 2005
Currently Being Moderated
Jun 25, 2012 1:53 PM in response to: bitbonk
Re: brace layout without indentation

Hello

     You can turn off the 'Indent anonymous method body' and 'Indent object/array/collection initializer' options under ReSharper | Options | Code Editing | C# | Code Style | Other. However, this won't eliminate indentation completely. Let me know if this helps. Thank you!

 

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

More Like This

  • Retrieving data ...