public override void Add(string key, JSONNode item) { var result = new JSONObject {{key, item}}; Set(result); }
private void Set(JSONNode value) { if (_key == null) _node.Add(value); else _node.Add(_key, value); _node = null; }
public override void Add(JSONNode item) { var result = new JSONArray {item}; Set(result); }
public JSONLazyCreator(JSONNode node) { _node = node; _key = null; }
public JSONLazyCreator(JSONNode node, string key) { _node = node; _key = key; }
public virtual JSONNode Remove(JSONNode node) { return node; }
public override JSONNode Remove(JSONNode node) { try { var item = _dict.First(k => k.Value == node); _dict.Remove(item.Key); return node; } catch { return null; } }
public override void Add(string key, JSONNode item) { if (!string.IsNullOrEmpty(key)) { if (_dict.ContainsKey(key)) _dict[key] = item; else _dict.Add(key, item); } else { _dict.Add(Guid.NewGuid().ToString(), item); } }
public override JSONNode Remove(JSONNode node) { _list.Remove(node); return node; }
public override void Add(JSONNode item) { _list.Add(item); }
public virtual void Add(JSONNode item) { Add("", item); }
public virtual void Add(string key, JSONNode item) { }