private void GetRSSFeed() { SinglyLinkedNode list = new SinglyLinkedNode(); for (int i = 0; i < url.Length; i++) { string[] source = url[i].Split(' '); XmlReader reader = XmlReader.Create(source[0]); SyndicationFeed feed = SyndicationFeed.Load(reader); reader.Close(); foreach (SyndicationItem item in feed.Items) { if (item.Title.Text.Length != 1) { BitmapImage image = null; try { image = new BitmapImage(new Uri(item.Links[1].Uri.ToString())); } catch (Exception ex) { } list.AddChild(new News(image, item.Title.Text, item.PublishDate, item.Links[0].Uri.ToString(), source[1])); } } } list.createList(newsList); }
public void createList(List <News> list) { list.Add(data); if (child != null) { child.createList(list); } }