public List <XMLDocExtended> GetAllNodes(List <XMLDocExtended> XDL = null) { if (XDL == null) { XDL = new List <XMLDocExtended>(); } foreach (XMLDocExtended XDN in this.GetChildNodes()) { XDN.GetAllNodes(XDL); XDL.Add(XDN); } return(XDL); }
public List <JsonExtended> GetAllNodes(List <JsonExtended> XDL = null) { if (XDL == null) { XDL = new List <JsonExtended>(); } foreach (JsonExtended XDN in this.GetChildNodes()) { int currentSize = XDL.Count; XDN.GetAllNodes(XDL); if (XDL.Where(x => x.GetToken().Parent == XDN.GetToken()).Count() == 0) { XDL.Add(XDN); } } return(XDL); }
public List <JsonExtended> GetAllNodes(List <JsonExtended> XDL = null) { if (XDL == null) { XDL = new List <JsonExtended>(); } List <JsonExtended> ChildNodeList = this.GetChildNodes(); foreach (JsonExtended XDN in ChildNodeList) { XDN.GetAllNodes(XDL); int contOfChiledWithSameTokenAsParent = XDL.Where(x => x.GetToken().Parent == XDN.GetToken()).Count(); if (contOfChiledWithSameTokenAsParent == 0) { XDL.Add(XDN); } } return(XDL); }