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 clearChilds(string objectName)
        {
            IJSONObject temp = this.find(objectName, false, this.root);

            if (temp != null)
            {
                //var childs = temp.__getChilds();
                var names = temp.__getChildsNames();
                foreach (var c in names)
                {
                    del(temp.__getChild(c));
                }
            }
        }
        private List <string> getChildsNames(IJSONObject currentItem = null)
        {
            List <string> retorno = new List <string>();

            if (currentItem == null)
            {
                currentItem = this.root;
            }

            var chieldsNames = currentItem.__getChildsNames();

            for (int cont = 0; cont < chieldsNames.Count; cont++)
            {
                retorno.Add(chieldsNames[cont]);
            }
            return(retorno);
        }
        private List <string> getObjectsNames(IJSONObject currentItem = null)
        {
            List <string> retorno = new List <string>();

            if (currentItem == null)
            {
                currentItem = this.root;
            }


            string parentName = "";

            List <string> childsNames;

            var chieldsNames = currentItem.__getChildsNames();

            for (int cont = 0; cont < chieldsNames.Count; cont++)
            {
                childsNames = getObjectsNames(currentItem.__getChild(chieldsNames[cont]));


                parentName = chieldsNames[cont];
                //adiciona os filhos ao resultado
                //verifica se o nome atual atende ao filtro
                foreach (var att in childsNames)
                {
                    string nAtt = att;
                    if (nAtt != "")
                    {
                        nAtt = parentName + '.' + nAtt;
                    }

                    retorno.Add(nAtt);
                }
                retorno.Add(chieldsNames[cont]);
            }
            return(retorno);
        }