public new ObjectTreeBuilder GetChild(string childPath) { if (string.IsNullOrEmpty(childPath)) { return(null); } if (children == null || children.Count == 0) { return(null); } else { ObjectTreeBuilder superChild = null; if (childPath.Contains("/")) { string[] splittedPath = childPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); if (!HasChild(splittedPath[0])) { return(null); } else { var child = this[splittedPath[0]]; superChild = child.GetChild(string.Join("/", splittedPath.Skip(1))); } } else { superChild = this[childPath]; } return(superChild); } }
public new ObjectTreeBuilder AddChild(string name, List <object> value) { var node = new ObjectTreeBuilder(name, value) { Parent = this }; children.Add(node); return(node); }
public ObjectTreeBuilder AddChild(ObjectTreeBuilder child) { child.Parent = this; this.children.Add(child); return(this); }