public void AddChild(JsonItem jsonItem) { if (this.children == null) { this.children = new List <JsonItem>(); } this.children.Add(jsonItem); }
/// <summary> /// This constructor is only used when a node already exists. /// The goal is to avoid circular dependency when transforming the object to json string. /// </summary> public JsonItem(JsonItem item) { this.name = Utils.GetDuplicateStr(item.name); }