public JsonReference CreateJsonReference(RWPathInfo reference) { if (root == null) { throw new NotSupportedException("Json root is not initialized."); } var result = new JsonReference(root, reference); // if (!result.TryGetValue(out var value) || value is ValueType) { jsonReference = result; } return(result); }
public void SetItem(IDataWriter writer, RWPathInfo destination) { if (items == null) { items = new LinkedList <Item>(); } if (jsonReference != null) { items.AddLast(new Item(jsonReference, writer, destination)); jsonReference = null; } else if (items != null && items.Count != 0 && items.Last.Value.Writer is IDataReader reader) { var jsonReference = new JsonReference(reader, RWPathInfo.Root); items.AddLast(new Item(jsonReference, writer, destination)); } }
public Item(JsonReference source, IDataWriter writer, RWPathInfo destination) { Source = source; Writer = writer; Destination = destination; }