public static List <ServiceTO> ReadSiblings(XmlReader reader) { List <ServiceTO> list = new List <ServiceTO>(); /* * true if a matching descendant element is found; otherwise false. * If a matching child element is not found, the XmlReader is positioned * on the end tag (NodeType is XmlNodeType.EndElement) of the element. * If the XmlReader is not positioned on an element when ReadToDescendant * was called, this method returns false and the position of the XmlReader * is not changed. */ bool found = reader.ReadToDescendant(ServiceTO.SERVICE); if (found) { do { ServiceTO service = new ServiceTO(new List <PropTO>()); service.setProps(PropTO.ReadSiblings(reader)); list.Add(service); } while (reader.ReadToNextSibling(ServiceTO.SERVICE)); } return(list); }
public void ReadXml(XmlReader reader) { bool found = true; if (!SERVICE.Equals(reader.LocalName)) { found = reader.ReadToDescendant(SERVICE); } if (found) { this.propTOs = PropTO.ReadSiblings(reader); } }