Ejemplo 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();
        }
Ejemplo n.º 2
0
 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);
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public RssFeedBuilder(IRss item)
     : this(new List<IRss> { item })
 { }
Ejemplo n.º 6
0
 public RssFeedBuilder(IRss item)
     : this(new List <IRss> {
     item
 })
 {
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 public void Initialize()
 {
     _repository = new Rss();
 }