public new SyndicationFeed Render() { if (this.IsCacheable()) { Sitecore.Caching.Cache.CacheEntry cacheEntry = this.GetCacheEntry(); if (cacheEntry != null) { return(Sitecore.Diagnostics.Assert.ResultNotNull <SyndicationFeed>( cacheEntry.Data as SyndicationFeed, "cached feed")); } } SyndicationFeed feed = new SyndicationFeed(); this.SetupFeed(feed); IEnumerable <Sitecore.Data.Items.Item> items = this.GetItems(); List <SyndicationItem> list = new List <SyndicationItem>(); foreach (Sitecore.Data.Items.Item item in items) { SyndicationItem item2 = this.RenderItem(item); if (item2 != null) { list.Add(item2); } } feed.Items = list; Sitecore.Syndication.FeedManager.Cache.Add( this.FeedItem.Uri.ToString(), feed, (long)(feed.Items.Count <SyndicationItem>() * 0xfd0), DateTime.Now + this.GetCacheDuration()); return(feed); }
public CacheEntry(Sitecore.Caching.Cache.CacheEntry entry) { this.Data = entry.Data; this.Expired = entry.Expired; this.Expiration = entry.AbsoluteExpiration; }