public static void WriteOpeningBraceToTranslation(this TranslationBuffer buffer, bool startOnNewLine = true) { if (startOnNewLine && buffer.TranslationQuery(q => !q.TranslationEndsWith('{'))) { buffer.WriteNewLineToTranslation(); } buffer.WriteToTranslation('{'); buffer.WriteNewLineToTranslation(); buffer.Indent(); }
public void WriteTo(TranslationBuffer buffer) { if ((_writeBlankLineBefore || buffer.TranslationQuery(q => q.TranslationEndsWith("};"))) && !buffer.TranslationQuery(q => q.TranslationEndsWithBlankLine())) { buffer.WriteNewLineToTranslation(); } if (_writeReturnKeyword) { buffer.WriteToTranslation("return "); } WriteStatementTo(buffer); if ((_suppressBlankLineAfter == false) && WriteBlankLineAfter()) { buffer.WriteNewLineToTranslation(); } }