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: 
You could write a *ReSharper Replace Pattern*.  

Add a pattern to Pattern Catalog by (in ReSharper 5.1.3 ReSharper->Tools->Pattern Catalog->Add Pattern). 

Then you write your pattern like so: 

![enter image description here](https://i.stack.imgur.com/PbZxZ.jpg)

Unfortunatly this does not work for if-else. So you need another pattern like so: 

![enter image description here](https://i.stack.imgur.com/GXpv9.jpg)

Then you can set pattern's severity in *Pattern Catalog* dialog and can click *Search now*.
you can use Brace Completer

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