Question: In C# (as in Java), curly braces are optional for e.g. if blocks and loops that only contain a single statement:

```
if (condition) DoSomething();

```

I am looking for a tool that inserts missing optional curly braces for my entire solution, turning the above code into something like this:

```
if (condition) {
    DoSomething();
}

```

I know that Eclipse can do this for Java. Unfortunately, I am not aware of a tool that can do this for C#. I would be grateful for suggestions! Thanks!

Answer: 
With ReSharper, go to `ReSharper | Options -> Code Editing | C# | Formatting Style | Braces Layout` and change neccessary options in `Force Braces` section to `Add braces`. Then find your solution in Solution Explorer, invoke context menu and choose `Cleanup code...` from it. Select `Default: Reformat code` and press `Run`. But be carefull! It would also reformat all code files in your solution. Be sure to backup if you do it the first time, just in case you wouldn't like ReSharper's default formatting. Maybe you would need to play with formatter settings to make it suit you.
you can use Brace Completer

<http://visualstudiogallery.msdn.microsoft.com/0e33cb22-d4ac-4f5a-902f-aff5177cc94d>