/// <summary> /// Parses xml string into RssFeed /// </summary> /// <param name="feedXml">XML of feed</param> /// <param name="source">Description of feed source</param> /// <returns>Parsed feed</returns> public static RssFeed Load(string feedXml, IFeedSource source = null) { XmlReader xmlFeedReader = XmlReader.Create(new StringReader(feedXml)); SyndicationFeed syndicationFeed = SyndicationFeed.Load(xmlFeedReader); return(Load(syndicationFeed, source)); }
public void RemoveUserFeedSource(IFeedSource feedSource) { if (_FeedSourceList.Remove(feedSource)) { IsNeedRefresh = true; } }
public FeedItemSourceListItem(IFeedSource source, FeedGroupPageViewModel feedGroupPageVM) { FeedSource = source; FeedGroupPageVM = feedGroupPageVM; Name = FeedSource.Name; }
public FeedWriter(IFeedSource <T> feedSource, IFeedDefinition <T> definition, ILinkSource <T> links, IUrlRegistry urls) { _feedSource = feedSource; _definition = definition; _links = links; _urls = urls; }
private RssFeed(string title, string link, string description, BitmapImage image, IFeedSource source) { Title = title; Link = link; Description = description; Image = image; Source = source; _entries = new List <RssEntry>(); }
public virtual SyndicationFeed BuildFeed(IFeedSource <T> source) { var feed = new SyndicationFeed(); _definition.ConfigureFeed(feed, _urls); feed.Items = buildItems(source); return(feed); }
/// <summary> /// Downloads feed from feed source /// </summary> /// <param name="source">Description of feed source</param> /// <returns>New RssFeed</returns> public static async Task <RssFeed> Load(IFeedSource source) { WebClient webClient = new WebClient { Encoding = Encoding.UTF8 }; string feedString = await webClient.DownloadStringTaskAsync(source.SourceUri); return(Load(feedString, source)); }
/// <summary> /// Converts syndication feed to rss feed /// </summary> /// <param name="syndicationFeed">Feed to converts</param> /// <param name="source">Description of feed source</param> /// <returns></returns> public static RssFeed Load(SyndicationFeed syndicationFeed, IFeedSource source = null) { RssFeed feed = new RssFeed( syndicationFeed.Title?.Text, syndicationFeed.Links.FirstOrDefault()?.Uri?.ToString(), syndicationFeed.Description?.Text, syndicationFeed.ImageUrl == null ? null : new BitmapImage(syndicationFeed.ImageUrl), source); feed._entries.AddRange(syndicationFeed.Items.Select(e => RssEntry.FromSyndicationItem(feed, e))); return(feed); }
private IEnumerable <SyndicationItem> buildItems(IFeedSource <T> source) { return(source.GetValues().Select(buildItem)); }
public FeedController(IFeedSource singleSource) { _source = singleSource; }