public void ReadXml(XmlReader reader) { while (reader.Read()) { if (reader.IsStartElement()) { switch (reader.Name) { case "Work": work = new WorkOfArt(); work.ReadXml(reader); break; case "Fund": fund = new Fund(); fund.ReadXml(reader); break; case "Location": location = (Location)Enum.Parse(typeof(Location), reader.Value); fund.ReadXml(reader); break; case "Price": reader.Read(); price = Int32.Parse(reader.Value); break; } } if (reader.Name.Equals("Exhibit")) { break; } } }
public Exhibit() { this.work = new WorkOfArt(); this.location = new Location(); this.fund = new Fund(); }