public void Visit(SteSwitchCase code) { TextComposer.AppendAtNewLine("switch ("); code.SwitchExpression.AcceptVisitor(this); TextComposer .AppendLine(")") .AppendLine("{") .IncreaseIndentation(); foreach (var item in code.CasesList) { item.AcceptVisitor(this); } if (code.DefaultCode != null) { TextComposer.AppendLineAtNewLine("default:").IncreaseIndentation(); code.DefaultCode.AcceptVisitor(this); TextComposer.AppendLineAtNewLine("break;"); } TextComposer .DecreaseIndentation() .AppendLineAtNewLine("}"); }
public void Visit(TccTryCatchItem code) { TextComposer.AppendLineAtNewLine("catch ("); code.CatchException.AcceptVisitor(this); TextComposer .AppendLine(")") .AppendLine("{") .IncreaseIndentation(); code.CatchCode.AcceptVisitor(this); TextComposer .DecreaseIndentation() .AppendLineAtNewLine("}"); }
public void Visit(TccSwitchCaseItem code) { TextComposer.AppendAtNewLine("case "); code.CaseValue.AcceptVisitor(this); TextComposer.AppendLine(":").IncreaseIndentation(); code.CaseCode.AcceptVisitor(this); if (code.BreakCase) { TextComposer.AppendLineAtNewLine("break;"); } TextComposer.DecreaseIndentation(); }
public void Visit(SteTryCatch code) { TextComposer .AppendLineAtNewLine("try") .AppendLine("{") .IncreaseIndentation(); code.TryCode.AcceptVisitor(this); TextComposer .DecreaseIndentation() .AppendLineAtNewLine("}"); if (code.CatchItems.Count == 0) { TextComposer .AppendLineAtNewLine("catch") .AppendLine("{") .AppendLine("}"); } else { foreach (var item in code.CatchItems) { item.AcceptVisitor(this); } } if (code.FinallyCode != null) { TextComposer .AppendLineAtNewLine("finally") .AppendLine("{") .IncreaseIndentation(); code.FinallyCode.AcceptVisitor(this); TextComposer .DecreaseIndentation() .AppendLineAtNewLine("}"); } }
internal void GenerateEndRegion() { TextComposer.AppendLineAtNewLine(@"#endregion"); }
internal void GenerateBeginRegion(string regionText) { TextComposer.AppendLineAtNewLine(@"#region " + regionText); }