Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlogViewModel" /> class.
        /// </summary>
        /// <param name="rss">The RSS.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="resourceLoader">The resource loader.</param>
        /// <exception cref="System.ArgumentNullException"></exception>
        public BlogViewModel(IRss rss ,INavigationService navigationService, ResourceLoader resourceLoader) : base(navigationService, resourceLoader)
        {
            if(rss == null)
            {
                throw new  ArgumentNullException("rss");
            }

            _rss = rss;

            BlogPosts = new ObservableCollection<BlogPost>();
            LoadBlogPosts();
        }
 private SyndicationItem BuildSyndicationItem(IRss singleItem)
 {
     var feedItem = new SyndicationItem()
     {
         Title = new TextSyndicationContent(singleItem.Title),
         BaseUri = singleItem.Link,
         LastUpdatedTime = singleItem.CreatedAt,
         Content = new TextSyndicationContent(singleItem.Description)
     };
     feedItem.Authors.Add(new SyndicationPerson() { Name = singleItem.Author });
     return feedItem;
 }
        public DatabaseRssNotificationsSender(DiscordSocketClient client, IRssNotifications notifications, IRss rss, IDatabaseService database)
        {
            _database      = database;
            _client        = client;
            _notifications = notifications;
            _rss           = rss;

            try
            {
                _database.Exec("CREATE TABLE IF NOT EXISTS `RssNotificationsSent` (`ChannelId` TEXT NOT NULL, `FeedUrl` TEXT NOT NULL, `UniqueId` TEXT)");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private SyndicationItem BuildSyndicationItem(IRss singleItem)
        {
            var feedItem = new SyndicationItem()
            {
                Title           = new TextSyndicationContent(singleItem.Title),
                BaseUri         = singleItem.Link,
                LastUpdatedTime = singleItem.CreatedAt,
                Content         = new TextSyndicationContent(singleItem.Description)
            };

            feedItem.Authors.Add(new SyndicationPerson()
            {
                Name = singleItem.Author
            });
            return(feedItem);
        }
 public RssFeedBuilder(IRss item)
     : this(new List<IRss> { item })
 { }
 public RssFeedBuilder(IRss item)
     : this(new List <IRss> {
     item
 })
 {
 }
 private static string CreateDescriptionFromPermanlink(IRss item, Uri permalink)
 {
     //use html tools?
     return string.Format("<a href=\"{0}\" rel=\"bookmark\" " +
                          "title=\"Permanent link to '{1}'\" class=\"glyph\">∞ Go to Item</a>", permalink, item.Title);
 }
Esempio n. 8
0
 public void Initialize()
 {
     _repository = new Rss();
 }