public void Entry_Expanded() { var dest = new RssEntry(GetInvoker()); Assert.That(dest.Expanded, Is.False); dest.Expanded = true; Assert.That(dest.Expanded, Is.False); }
public void Entry_Expanded() { var dest = new RssEntry(new SynchronizationContext()); Assert.That(dest.Context, Is.Not.Null); Assert.That(dest.Expanded, Is.False); dest.Expanded = true; Assert.That(dest.Expanded, Is.False); }
public void UpdateGlobalRss() { var rssChannels = this.updateRepository.LoadAllGlobalRssChannels(); var rssEntriesList = new List <RssEntry>(); foreach (var rssChannel in rssChannels) { try { var syndicationEntries = this.syndicationFeedAdapter.Load(rssChannel.Url); foreach (var item in syndicationEntries.Where(item => item.PublishDate > rssChannel.RssLastUpdatedTime)) { var rssEntry = new RssEntry( item.Id, item.PublishDate, item.Title, item.Summary, rssChannel.Id, item.Url); rssEntriesList.Add(rssEntry); } if (syndicationEntries.Any()) { rssChannel.RssLastUpdatedTime = syndicationEntries.Max(d => d.PublishDate); } this.rssEntriesRepository.SaveToDatabase(rssEntriesList); var rssChannelUpdated = new EventRssChannelUpdated { RssChannelId = rssChannel.Id }; this.rssChannelsUpdatedRepository.SaveEvent(rssChannelUpdated); } catch (XmlException e) { System.Diagnostics.Debug.WriteLine(e.Message); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); } rssEntriesList.Clear(); } this.rssChannelsRepository.UpdateRssLastUpdateTimeToDatabase(rssChannels); rssChannels.Clear(); }
public void DeleteRss(RssEntry rssEntry) { using (var db = new RssContext()) { var item = db.RssEntries.Find(rssEntry.Id); if (item == null) { return; } db.RssEntries.Remove(item); db.SaveChanges(); _feeds.Remove(rssEntry); } }
public void Entry_Update_Error() { var dest = new RssEntry(GetInvoker()) { Uri = new Uri("https://blog.cube-soft.jp/?feed=rss2"), Link = new Uri("https://blog.cube-soft.jp/"), Count = 0, Frequency = RssCheckFrequency.High, Title = "CubeSoft Blog", }; var src = new RssFeed { Uri = new Uri("https://blog.cube-soft.jp/?feed=rss2"), Error = new ArgumentException("Test"), LastChecked = DateTime.Now, }; dest.Update(src); Assert.That(dest.LastChecked.HasValue, Is.True); Assert.That(src.Title, Is.EqualTo(dest.Title)); }
public RssFeedAdded(RssEntry rssEntry) { RssEntry = rssEntry; }
public void Handle(ReadingRssEvent message) { _lastRssEntry = message.RssEntry; TaskbarIcon.ShowBalloonTip(message.RssEntry.Title, message.RssEntry.Url, BalloonIcon.Info); }
public ReadingRssEvent(RssEntry rssEntry) { RssEntry = rssEntry; }
public void OpenRss(RssEntry rssEntry) { Process.Start(rssEntry.Url); }