public void WriteObjectStart() { this.DoValidation(Condition.NotAProperty); this.PutNewline(); this.Put("{"); this.context = new WriterContext(); this.context.InObject = true; this.ctx_stack.Push(this.context); this.Indent(); }
public void Reset() { this.has_reached_end = false; this.ctx_stack.Clear(); this.context = new WriterContext(); this.ctx_stack.Push(this.context); if (this.inst_string_builder != null) { this.inst_string_builder.Remove(0, this.inst_string_builder.Length); } }
public void WriteObjectEnd() { this.DoValidation(Condition.InObject); this.PutNewline(false); this.ctx_stack.Pop(); if (this.ctx_stack.Count == 1) { this.has_reached_end = true; } else { this.context = this.ctx_stack.Peek(); this.context.ExpectingValue = false; } this.Unindent(); this.Put("}"); }
private void Init() { this.has_reached_end = false; this.hex_seq = new char[4]; this.indentation = 0; this.indent_value = 4; this.pretty_print = false; this.validate = true; this.ctx_stack = new Stack<WriterContext>(); this.context = new WriterContext(); this.ctx_stack.Push(this.context); }