private void del(IJSONObject node) { node.clear(); var childs = node.__getChildsNames(); foreach (var c in childs) { del(node.__getChild(c)); } childs.Clear(); /* * var parentNodesNames = node.parent.__getChildsNames(); * for (int cont = 0; cont < parentNodesNames.Count; cont++) * { * if (parentNodesNames[cont] == node) * { * //if parent is an array, pull the elements forward backwards * if (node.parent.isArray()) * { * for (int cont2 = cont; cont2 < parentNodes.Count - 1; cont2++) * parentNodes[parentNodes.ElementAt(cont2).Key] = parentNodes[parentNodes.ElementAt(cont2 + 1).Key]; * * parentNodes.Remove(parentNodes.Last().Key); * } * else * { * parentNodes.Remove(parentNodes.ElementAt(cont).Key); * } * break; * } * }*/ }
public void clear() { root.clear(); }