static StockJsonBuffers() { JsonBufferWriter writer = new JsonBufferWriter(2); writer.WriteStartObject(); writer.WriteEndObject(); EmptyObject = writer.GetBuffer(); }
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())); }