Exemple #1
0
        public static List <WorkOfArt> ReadWorkOfArtList(XmlReader reader)
        {
            List <WorkOfArt> workOfArts = new List <WorkOfArt>();

            reader.MoveToContent();
            while (reader.Read())
            {
                if (reader.IsStartElement() && !reader.Name.Equals("WorkOfArt"))
                {
                    WorkOfArt lumber = new WorkOfArt();
                    lumber.ReadXml(reader);
                    workOfArts.Add(lumber);
                }
                else
                {
                    break;
                }
            }
            return(workOfArts);
        }
Exemple #2
0
        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;
                }
            }
        }