private static CSharpCodeWritingScope BuildLambda(CodeWriter writer, bool async, string[] parameterNames) { if (async) { writer.Write("async"); } writer.Write("(").Write(string.Join(", ", parameterNames)).Write(") => "); var scope = new CSharpCodeWritingScope(writer); return(scope); }
public CSharpCodeWritingScope BuildLambda(bool endLine, params string[] parameterNames) { Write("(").Write(string.Join(", ", parameterNames)).Write(") => "); var scope = new CSharpCodeWritingScope(this); if (endLine) { // End the lambda with a semicolon scope.OnClose += () => { WriteLine(";"); }; } return(scope); }
private CSharpCodeWritingScope BuildLambda(bool endLine, bool async, string[] parameterNames) { if (async) { Write("async"); } Write("(").Write(string.Join(", ", parameterNames)).Write(") => "); var scope = new CSharpCodeWritingScope(this); if (endLine) { // End the lambda with a semicolon scope.OnClose += () => { WriteLine(";"); }; } return scope; }