Exemplo n.º 1
0
        /// <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));
        }
Exemplo n.º 2
0
		public void RemoveUserFeedSource(IFeedSource feedSource)
		{
			if (_FeedSourceList.Remove(feedSource))
			{
				IsNeedRefresh = true;
			}
		}
Exemplo n.º 3
0
        public FeedItemSourceListItem(IFeedSource source, FeedGroupPageViewModel feedGroupPageVM)
        {
            FeedSource      = source;
            FeedGroupPageVM = feedGroupPageVM;

            Name = FeedSource.Name;
        }
Exemplo n.º 4
0
 public FeedWriter(IFeedSource <T> feedSource, IFeedDefinition <T> definition, ILinkSource <T> links,
                   IUrlRegistry urls)
 {
     _feedSource = feedSource;
     _definition = definition;
     _links      = links;
     _urls       = urls;
 }
Exemplo n.º 5
0
 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>();
 }
Exemplo n.º 6
0
        public virtual SyndicationFeed BuildFeed(IFeedSource <T> source)
        {
            var feed = new SyndicationFeed();

            _definition.ConfigureFeed(feed, _urls);
            feed.Items = buildItems(source);

            return(feed);
        }
Exemplo n.º 7
0
        /// <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));
        }
Exemplo n.º 8
0
        /// <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);
        }
Exemplo n.º 9
0
 private IEnumerable <SyndicationItem> buildItems(IFeedSource <T> source)
 {
     return(source.GetValues().Select(buildItem));
 }
Exemplo n.º 10
0
 public FeedController(IFeedSource singleSource)
 {
     _source = singleSource;
 }