views:

311

answers:

2

I'm using Visual Studio 2005. It always wants to format switch statements like this:

switch (thing)
{
case A:
  stuff;
  break;

case B:
  things;
  break;
}

Is there a way to have it indent the cases like this?:

switch (thing)
{
  case A:
    stuff;
    break;

  case B:
    things;
    break;
}
+5  A: 

Go here:

Tools > Options > Text Editor > C# > Formatting > Indentation > Indent case labels

Andrew Hare
A: 

Tools | Options | Text Editor | c# -> check 'Ident block contents' checkbox.

Mez