Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Source Code Formatting in array initializer

Is it possible to enable C# source code formatting inside array initializers in VS.NET 2010?

Elements =
{
// starting from here source code formatting does not work
  new TextViewModel("PublicId") 
  { 
    Label = new LText("Fund Nr:", "de", "Fondsnummer"),
    Watermark = new LText("Please enter fund number...", "de", "Bitte hier Fondsnummer erfassen...")
  },
  new CheckViewModel("Juristic")
  {
    Style = "Radio",
    Default = true,
    Label = new LText("Juristic Fund", "de", "Juristischer Fonds")
  }
}    
// starting from here source code formatting works again

Am I missing some formatting option in Tools->Options->Text Editor->C#?

like image 448
Lex Lavnikov Avatar asked Nov 25 '10 15:11

Lex Lavnikov


1 Answers

It's a "Won't fix" at connect.microsoft.

But, as posted there by Microsoft:

If others, find that this is an important feature, please keep voting it up.

Note that this is only for multi-line initializers.

like image 142
ispiro Avatar answered Oct 02 '22 22:10

ispiro