Пример #1
0
        public void WriteObjectEnd()
        {
            DoValidation(Condition.InObject);
            PutNewline(false);

            ctx_stack.Pop();
            if (ctx_stack.Count == 1)
            {
                has_reached_end = true;
            }
            else
            {
                context = ctx_stack.Peek();
                context.ExpectingValue = false;
            }

            Unindent();
            Put("}");
        }
Пример #2
0
        public void WriteArrayEnd(bool indent = true)
        {
            DoValidation(Condition.InArray);
            PutNewline(false);

            ctx_stack.Pop();
            if (ctx_stack.Count == 1)
            {
                has_reached_end = true;
            }
            else
            {
                context = ctx_stack.Peek();
                context.ExpectingValue = false;
            }
            if (indent)
            {
                Unindent();
            }
            Put("]");
        }
Пример #3
0
        public void WriteObjectStart(/*string name = null*/)
        {
            DoValidation(Condition.NotAProperty);
            PutNewline();
            //if (null != name && name.Length > 0)
            //{
            //    System.Text.StringBuilder sb = new System.Text.StringBuilder();
            //    sb.Append("\"");
            //    sb.Append(name);
            //    sb.Append("\" :{");
            //    Put(sb.ToString());
            //    //Put(string.Format(@"""{0}"": {", name));
            //}
            //else
            {
                Put("{");
            }

            context          = new WriterContext();
            context.InObject = true;
            ctx_stack.Push(context);

            Indent();
        }
Пример #4
0
        public void WriteObjectEnd()
        {
            DoValidation (Condition.InObject);
            PutNewline (false);

            ctx_stack.Pop ();
            if (ctx_stack.Count == 1)
                has_reached_end = true;
            else {
                context = ctx_stack.Peek ();
                context.ExpectingValue = false;
            }

            Unindent ();
            Put ("}");
        }
Пример #5
0
        public void Reset()
        {
            has_reached_end = false;

            ctx_stack.Clear ();
            context = new WriterContext ();
            ctx_stack.Push (context);

            if (inst_string_builder != null)
                inst_string_builder.Remove (0, inst_string_builder.Length);
        }
Пример #6
0
        private void Init()
        {
            _hasReachedEnd = false;
            _hexSeq = new char[4];
            _indentation = 0;
            _indentValue = 4;
            _prettyPrint = false;
            _validate = true;

            _ctxStack = new Stack<WriterContext> ();
            _context = new WriterContext ();
            _ctxStack.Push (_context);
        }
Пример #7
0
        public void WriteObjectEnd()
        {
            DoValidation (Condition.InObject);
            PutNewline (false);

            _ctxStack.Pop ();
            if (_ctxStack.Count == 1)
                _hasReachedEnd = true;
            else {
                _context = _ctxStack.Peek ();
                _context.ExpectingValue = false;
            }

            Unindent ();
            Put ("}");
        }
Пример #8
0
        public void WriteArrayStart()
        {
            DoValidation (Condition.NotAProperty);
            PutNewline ();

            Put ("[");

            _context = new WriterContext {InArray = true};
            _ctxStack.Push (_context);

            Indent ();
        }
Пример #9
0
        public void Reset()
        {
            _hasReachedEnd = false;

            _ctxStack.Clear ();
            _context = new WriterContext ();
            _ctxStack.Push (_context);

            if (_instStringBuilder != null)
                _instStringBuilder.Remove (0, _instStringBuilder.Length);
        }
Пример #10
0
 public void WriteArrayStart()
 {
     this.DoValidation(Condition.NotAProperty);
     this.PutNewline();
     this.Put("[");
     this.context = new WriterContext();
     this.context.InArray = true;
     this.ctx_stack.Push(this.context);
     this.Indent();
 }
Пример #11
0
 public void WriteArrayEnd()
 {
     DoValidation(Condition.InArray);
     PutNewline(false);
     ctxStack.Pop();
     if (ctxStack.Count == 1) {
     hasReachedEnd = true;
     } else {
     context = ctxStack.Peek();
     context.ExpectingValue = false;
     }
     Unindent();
     Put("]");
 }
Пример #12
0
        public void Reset()
        {
            hasReachedEnd = false;

            ctxStack.Clear();
            context = new WriterContext();
            ctxStack.Push(context);

            if (stringBuilder != null) {
            stringBuilder.Remove(0, stringBuilder.Length);
            }
        }
Пример #13
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);
 }
Пример #14
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("}");
 }
Пример #15
0
        public void WriteObjectStart()
        {
            DoValidation (Condition.NotAProperty);
            PutNewline ();

            Put ("{");

            context = new WriterContext ();
            context.InObject = true;
            ctx_stack.Push (context);

            Indent ();
        }
Пример #16
0
        private void Init()
        {
            hasReachedEnd = false;
            hexSeq = new char[4];
            indentation = 0;
            indentValue = 4;
            PrettyPrint = false;
            Validate = true;

            TypeHinting = false;
            HintTypeName = "__type__";
            HintValueName = "__value__";

            ctxStack = new Stack<WriterContext>();
            context = new WriterContext();
            ctxStack.Push(context);
        }
Пример #17
0
        private void Init()
        {
            has_reached_end = false;
            hex_seq = new char[4];
            indentation = 0;
            indent_value = 4;
            pretty_print = false;
            validate = true;

            ctx_stack = new Stack<WriterContext> ();
            context = new WriterContext ();
            ctx_stack.Push (context);
        }
Пример #18
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);
     }
 }