private void GetParts(SnipPagePartCollection snipPagePartCollection, XmlElement partsEle, SnipPageDesigner designer) { XmlNodeList _nodes = partsEle.SelectNodes("part"); foreach (XmlNode node in _nodes) { SnipPartXmlElement partEle = (SnipPartXmlElement)node; SnipPagePart part = SnipPagePart.Parse(partEle, designer); snipPagePartCollection.Add(part); GetParts(part.ChildParts, partEle, designer); } }
/// <summary> /// 将element里保存的数据读取到parts(递归) /// </summary> private void GetParts(SnipPagePart part, XmlElement element) { XmlNodeList _nodes = element.SelectNodes("part"); //part.ChildParts.Clear(); foreach (XmlNode node in _nodes) { SnipPartXmlElement partEle = (SnipPartXmlElement)node; SnipPagePart _part = SnipPagePart.Parse(partEle, this.Designer); part.ChildParts.Add(_part); GetParts(_part, partEle); } }