public void ReadXml(XmlReader reader) { reader.MoveToContent(); Value = reader["Value"]; if (reader.IsEmptyElement) { reader.ReadStartElement(); return; } reader.ReadStartElement(); while (!reader.EOF) { if (reader.IsStartElement()) { switch (reader.Name) { case "Animation": XmlAnimationElement animation = new XmlAnimationElement(); animation.ReadXml(reader); Animation = animation; break; default: reader.Skip(); break; } } else if (reader.NodeType == XmlNodeType.EndElement) { reader.ReadEndElement(); break; } else reader.Read(); } }
public void ReadXml(XmlReader reader) { reader.MoveToContent(); if (reader.IsEmptyElement) { reader.ReadStartElement(); return; } reader.ReadStartElement(); while (!reader.EOF) { if (reader.IsStartElement()) { switch (reader.Name) { case "Instance": XmlAnimatedSpriteInstance instance = new XmlAnimatedSpriteInstance(); instance.ReadXml(reader); Instance = instance; break; case "Sprites": XmlSpriteListElement sprites = new XmlSpriteListElement(); sprites.ReadXml(reader); Sprites = sprites; break; case "Animation": XmlAnimationElement animation = new XmlAnimationElement(); animation.ReadXml(reader); Animation = animation; break; default: reader.Skip(); break; } } else if (reader.NodeType == XmlNodeType.EndElement) { reader.ReadEndElement(); break; } else reader.Read(); } }