internal static IndentedTextWriter GetIndentedTextWriter(TextWriter writer, JsFormatter formatter) { return(new IndentedTextWriter(writer, formatter.TabString) { NewLine = formatter.Newline }); }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { writer.Write("while"); writer.Write(formatter.Padding + "("); Condition.Write(writer, formatter); writer.Write(")" + formatter.Padding); Action.Write(writer, formatter); }
public virtual string ToString(JsFormatter formatter) { using (var sw = new StringWriter()) { Write(sw, formatter); return sw.ToString(); } }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { writer.WriteLine("{"); writer.Indent++; foreach (var js in Body) js.Write(writer, formatter); writer.Indent--; writer.Write("}"); }
public virtual string ToString(JsFormatter formatter) { using (var sw = new StringWriter()) { Write(sw, formatter); return(sw.ToString()); } }
public void Write(TextWriter tw, JsFormatter formatter = null) { if (formatter == null) formatter = JsFormatter.Default; using (var writer = GetIndentedTextWriter(tw, formatter)) { Write(writer, formatter); } }
public void Write(TextWriter tw, JsFormatter formatter = null) { if (formatter == null) { formatter = JsFormatter.Default; } using (var writer = GetIndentedTextWriter(tw, formatter)) { Write(writer, formatter); } }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { writer.Write("if"); writer.Write(formatter.Padding + "("); Condition.Write(writer, formatter); writer.Write(")" + formatter.Padding); Action.Write(writer, formatter); if (Else != null) { writer.Write("else"); writer.Write(Else is JsBlock ? formatter.Padding : " "); Else.Write(writer, formatter); } }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { writer.Write("function"); if (!string.IsNullOrEmpty(Name)) writer.Write(string.Concat(" ", Name)); writer.Write(formatter.Padding + "("); writer.Write(string.Join("," + formatter.Padding, Parameters)); writer.Write(")" + formatter.Padding); writer.WriteLine("{"); writer.Indent++; foreach (var js in Body) js.Write(writer, formatter); writer.Indent--; writer.Write("}"); }
internal virtual void Write(IndentedTextWriter writer, JsFormatter formatter) { throw new InvalidOperationException(); }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { Left.Write(writer, formatter); writer.Write(string.Format("{1}{0}{1}", Operator, " ")); Right.Write(writer, formatter); }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { writer.Write(Name); }
internal static IndentedTextWriter GetIndentedTextWriter(TextWriter writer, JsFormatter formatter) { return new IndentedTextWriter(writer, formatter.TabString) { NewLine = formatter.Newline }; }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { Left.Write(writer, formatter); writer.Write(string.Format("{1}{0}{1}", Operator, formatter.Padding)); Right.Write(writer, formatter); }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { base.Write(writer, formatter); writer.WriteLine(";"); }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { writer.Write("return "); Expression.Write(writer, formatter); writer.WriteLine(";"); }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { writer.Write("function"); if (!string.IsNullOrEmpty(Name)) { writer.Write(string.Concat(" ", Name)); } writer.Write(formatter.Padding + "("); writer.Write(string.Join("," + formatter.Padding, Parameters)); writer.Write(")" + formatter.Padding); writer.WriteLine("{"); writer.Indent++; foreach (var js in Body) { js.Write(writer, formatter); } writer.Indent--; writer.Write("}"); }
internal override void Write(System.CodeDom.Compiler.IndentedTextWriter writer, JsFormatter formatter) { writer.WriteLine("{"); writer.Indent++; foreach (var js in Body) { js.Write(writer, formatter); } writer.Indent--; writer.Write("}"); }