Esempio n. 1
0
 static StockJsonBuffers()
 {
     JsonBufferWriter writer = new JsonBufferWriter(2);
     writer.WriteStartObject();
     writer.WriteEndObject();
     EmptyObject = writer.GetBuffer();
 }
Esempio n. 2
0
        private static JsonReader Export(object value)
        {
            var writer = new JsonBufferWriter();

            JsonConvert.Export(value, writer);
            return(writer.GetBuffer().CreateReader());
        }
Esempio n. 3
0
        static StockJsonBuffers()
        {
            JsonBufferWriter writer = new JsonBufferWriter(2);

            writer.WriteStartObject();
            writer.WriteEndObject();
            EmptyObject = writer.GetBuffer();
        }
Esempio n. 4
0
        public virtual ObjectConstructionResult CreateObject(ImportContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            JsonBufferWriter tailw = _tailw;

            _tailw = null;
            if (tailw != null)
            {
                tailw.WriteEndObject();
            }
            JsonBuffer tail = (tailw != null ? tailw.GetBuffer() : StockJsonBuffers.EmptyObject);
            object     obj  = OnCreateObject(context);

            return(new ObjectConstructionResult(obj, tail.CreateReader()));
        }
Esempio n. 5
0
 private static JsonReader Export(object value)
 {
     var writer = new JsonBufferWriter();
     JsonConvert.Export(value, writer);
     return writer.GetBuffer().CreateReader();
 }