Here is a simple example of a one-lined IF statement.
if(condition)
something = "blah";
I find myself using them often for simple things, but later on while expanding the application, expanding them to a multi-lined if statements
if(condition)
{
something = "blah;
somethingElse = "blar";
}
But I find this quite frustrating because I have to go through several steps to do so. When I enter the first brace, my code formatter (Visual Studio? Resharper?) proceeds to enter a second (closing) brace, and formats it like so:
if(condition) { }
something = "blah";
I then have to select and remove the closing brace, and do my own formatting to get it to look correct.
Is there a way that I can conveniently have resharper or visual studio automatically enter the braces around the one-lined IF statement? e.g: I entered an opening brace after the condition and it automatically formatted it like
if(condition)
{
something = "blah";
}