public void VisitSwitchStatement(JSwitchStatement node) { Write("switch"); Write("("); Visit(node.Expression); Write(")"); if (OpenBraceInNewLine) { WriteLine(); } BeginBlock(); VisitEach(node.Sections); EndBlock(); }
public static JSwitchStatement Case(this JSwitchStatement node, JExpression value, List <JStatement> statements) { if (node.Sections == null) { node.Sections = new List <JSwitchSection>(); } node.Sections.Add(new JSwitchSection { Labels = new List <JSwitchLabel> { new JSwitchLabel { Expression = value } }, Statements = statements }); return(node); }