public void ReadXml(XmlReader reader) { while (reader.MoveToNextAttribute()) { if (reader.Name == "appid") { appid = reader.Value; } else if (reader.Name == "status") { status = reader.Value; } } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (reader.Name == "updatecheck") { updatecheck = new UpdateResult(); XmlReader s = reader.ReadSubtree(); s.Read(); updatecheck.ReadXml(s); s.Close(); } else if (reader.Name == "ping") { ping = new PingResult(); XmlReader s = reader.ReadSubtree(); s.Read(); ping.ReadXml(s); s.Close(); } else if (reader.Name == "event") { if (event_responses == null) { event_responses = new List <EventResponse>(); } XmlReader s = reader.ReadSubtree(); EventResponse e_rsp = new EventResponse(); s.Read(); e_rsp.ReadXml(s); s.Close(); event_responses.Add(e_rsp); } else if (reader.Name == "data") { if (data_results == null) { data_results = new List <DataResult>(); } DataResult d_rst = new DataResult(); XmlReader s = reader.ReadSubtree(); s.Read(); d_rst.ReadXml(s); s.Close(); data_results.Add(d_rst); } } } }