Esempio n. 1
0
 private void ShowFeedAction(RssViewModel rss)
 {
     if (rss != null)
     {
         MessageBox.Show(string.Format("rss: {0}", rss.Title));
     }
 }
Esempio n. 2
0
        private void Weblient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            XElement _xml;
            try
            {
                if (!e.Cancelled)
                {
                    _xml = XElement.Parse(e.Result);

                    WebsiteFeed.Clear();
                    //Results.Items.Clear();
                    foreach (XElement value in _xml.Elements("channel").Elements("item"))
                    {
                        RssViewModel _item = new RssViewModel();
                        _item.Title = value.Element("title").Value;
                        _item.Description = Regex.Replace(value.Element("description").Value,
                        @"<(.|\n)*?>", String.Empty);
                        _item.Link = value.Element("link").Value;
                        _item.Guid = value.Element("guid").Value;
                        _item.Published = DateTime.Parse(value.Element("pubDate").Value);

                        DebugUtils.Log("trololo", string.Format("item : name:{0}", _item.Title));
                        WebsiteFeed.Add(_item);
                        //Results.Items.Add(_item);
                    }
                }
            }
            catch
            {
                // Ignore Errors
            }
        }