コード例 #1
0
 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();
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 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("}");
 }
コード例 #4
0
 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);
 }