public string Render() { TextDocumentCanvas canvas = new TextDocumentCanvas(); Render(canvas); return(canvas.ToString()); }
public void Render(TextDocumentCanvas canvas) { GetTyonType().Render(canvas); if (GetTyonAddress() != null) { canvas.AppendToLine("&"); GetTyonAddress().Render(canvas); } if (GetTyonValueList() != null) { canvas.AppendToLine("("); GetTyonValueList().Render(canvas, false); canvas.AppendToLine(")"); } if (GetTyonVariables().IsNotEmpty()) { canvas.AppendToLine(" {"); canvas.Indent(); GetTyonVariables().Process(v => v.Render(canvas)); canvas.Dedent(); canvas.AppendToNewline("}"); } }
static public string Regurgitate(this object item, int max_depth, bool verbose_exceptions) { TextDocumentCanvas canvas = new TextDocumentCanvas(); item.Regurgitate(canvas, max_depth, verbose_exceptions); return(canvas.ToString()); }
public void Render(TextDocumentCanvas canvas) { canvas.AppendToNewline(GetId()); canvas.AppendToLine(" = "); GetTyonValue().Render(canvas); canvas.AppendToLine(";"); }
public override void Render(TextDocumentCanvas canvas) { canvas.AppendToLine(GetId()); canvas.AppendToLine("<"); GetTyonTypes().ProcessWithInterleaving(t => t.Render(canvas), () => canvas.AppendToLine(",")); canvas.AppendToLine(">"); }
public override void Render(TextDocumentCanvas canvas) { canvas.AppendToNewline(text); canvas.AppendToNewline("{"); base.Render(canvas); canvas.AppendToNewline("}"); canvas.AppendNewline(); }
public override string RenderDocument() { TextDocumentCanvas canvas = new TextDocumentCanvas(); canvas.AppendLines(GenerateHeader()); canvas.AppendNewline(); Render(canvas); return(canvas.ToString()); }
public void Render(TextDocumentCanvas canvas) { GetTyonType().IfNotNull(t => t.Render(canvas)); canvas.AppendToLine(" ["); canvas.Indent(); canvas.AppendNewline(); GetTyonValueList().IfNotNull(l => l.Render(canvas, true)); canvas.Dedent(); canvas.AppendToNewline("]"); }
public void Render(TextDocumentCanvas canvas, bool multiline) { GetTyonValues().ProcessWithInterleaving( v => v.Render(canvas), () => { canvas.AppendToLine(", "); if (multiline) { canvas.AppendNewline(); } } ); }
static private void Regurgitate_IEnumerable(IEnumerable item, TextDocumentCanvas canvas, int max_depth, bool verbose_exceptions) { canvas.AppendToLine("["); canvas.Indent(); foreach (object sub_item in item) { canvas.AppendNewline(); sub_item.Regurgitate(canvas, max_depth - 1, verbose_exceptions); canvas.AppendToLine(";"); } canvas.Dedent(); canvas.AppendToNewline("]"); }
static public void Regurgitate(this object item, TextDocumentCanvas canvas, int max_depth, bool verbose_exceptions) { try { if (max_depth >= 1) { if (item == null) { Regurgitate_Null(item, canvas, max_depth, verbose_exceptions); } else { Type type = item.GetTypeEX(); if (type.IsPrimitive()) { Regurgitate_Primitive(item, canvas, max_depth, verbose_exceptions); } else if (type.IsTypicalIEnumerable()) { Regurgitate_IEnumerable((IEnumerable)item, canvas, max_depth, verbose_exceptions); } else { Regurgitate_Object(item, canvas, max_depth, verbose_exceptions); } } } else { canvas.AppendToLine("(Exceeded Depth)"); } } catch (Exception ex) { if (verbose_exceptions) { canvas.AppendToLine(ex.Message); } else { canvas.AppendToLine("(Exception)"); } } }
static private void Regurgitate_Object(object item, TextDocumentCanvas canvas, int max_depth, bool verbose_exceptions) { canvas.AppendToLine(item.GetType().ToString()); canvas.AppendToLine("{"); canvas.Indent(); foreach (FieldInfoEX field in item.GetAllInstanceFields()) { canvas.AppendNewline(); canvas.AppendToLine(field.Name); canvas.AppendToLine(": "); field.GetValue(item).Regurgitate(canvas, max_depth - 1, verbose_exceptions); canvas.AppendToLine(";"); } canvas.Dedent(); canvas.AppendToNewline("}"); }
public override void Render(TextDocumentCanvas canvas) { canvas.AppendToLine(GetId()); }
static private void Regurgitate_Primitive(object item, TextDocumentCanvas canvas, int max_depth, bool verbose_exceptions) { canvas.AppendToLine(item.ToString()); }
public override void Render(TextDocumentCanvas canvas) { canvas.AppendToLine("null"); }
public override void Render(TextDocumentCanvas canvas) { canvas.AppendToLine("&"); GetTyonAddress().Render(canvas); }
static private void Regurgitate_Null(object item, TextDocumentCanvas canvas, int max_depth, bool verbose_exceptions) { canvas.AppendToLine("null"); }
public override void Render(TextDocumentCanvas canvas) { GetTyonArray().Render(canvas); }
public void Render(TextDocumentCanvas canvas) { GetTyonType().Render(canvas); canvas.AppendToLine(":"); GetTyonValue().Render(canvas); }
public abstract void Render(TextDocumentCanvas canvas);
public override void Render(TextDocumentCanvas canvas) { GetTyonSurrogate().Render(canvas); }
public override void Render(TextDocumentCanvas canvas) { canvas.AppendToLine("typeof("); GetTyonType().Render(canvas); canvas.AppendToLine(")"); }
public override void Render(TextDocumentCanvas canvas) { canvas.AppendToLine(GetInt().StyleAsLiteral()); }
public override void Render(TextDocumentCanvas canvas) { canvas.AppendToLine(GetString().StyleAsDoubleQuoteLiteral()); }