Пример #1
0
 public Item(string type, Music ms)
 {
     this.Type = type;
     this.Music = ms;
 }
 public void XMlDocToData()
 {
     var data = XmlDoc.GetElementsByTagName("data");
     var dtdata = new ListItem();
     dtdata.Page = data[0].Attributes["page"].Value;
     var items = XmlDoc.GetElementsByTagName("item");
     var dsItem = new ListItem();
     foreach (XmlNode item in items)
     {
         var ms = new Music(item["title"].InnerText, item["performer"].InnerText, item["link"].InnerText, item["source"].InnerText, item["hq"].InnerText);
         var it = new Item(item.Attributes["type"].Value,ms);
         dsItem.ThemItem(it);
     }
     ListMusics = dsItem;
 }