public bool FromXml(XmlReader reader) { if (reader.Name != "Node") { return false; } reader.ReadStartElement(); Rounds = new List<Round>(); if (reader.Name == "Rounds") { reader.ReadStartElement(); Round round; while (reader.Name == "Round") { round = new Round(); if (!round.FromXml(reader)) { return false; } Rounds.Add(round); } if (reader.Name == "Rounds" && reader.NodeType == XmlNodeType.EndElement) { reader.ReadEndElement(); } } Items = new List<Item>(); if (reader.Name == "Items") { reader.ReadStartElement(); Item item; while (reader.Name == "Item") { item = new Item(); if (!item.FromXml(reader)) { return false; } Items.Add(item); } if (reader.Name == "Items" && reader.NodeType == XmlNodeType.EndElement) { reader.ReadEndElement(); } } if (reader.Name == "Node" && reader.NodeType == XmlNodeType.EndElement) { reader.ReadEndElement(); } return true; }
public void Value(Item[] result, int length) { int max = length < _Ucs.Count ? length : _Ucs.Count; for (int i = 0; i < max; i += 1) { _Ucs[i].Item = result[i]; } }