CheevoService.CheevoUser.GetLastUpdateTime C# (CSharp) Method

GetLastUpdateTime() public method

public GetLastUpdateTime ( ) : System.DateTime
return System.DateTime
        public DateTime GetLastUpdateTime()
        {
            DateTime time = DateTime.MinValue;
            foreach (var cheevo in currentCheevos)
            {
                if (cheevo.Awarded > time)
                {
                    time = cheevo.Awarded;
                }
            }
            return time;
        }

Usage Example

Example #1
0
        public static void Generate(CheevoUser user, Stream output)
        {
            RssFeed feed = new RssFeed();

            feed.Channel.Link = new Uri(Link);
            feed.Channel.Title = Title;
            feed.Channel.Description = Description;
            // the last build date must correspond to the 'newest' cheevo
            feed.Channel.LastBuildDate = user.GetLastUpdateTime();
            feed.Channel.PublicationDate = user.GetLastUpdateTime();

            foreach (var cheevo in user.ObtainedCheevos)
            {
                RssItem item = new RssItem();
                item.Title = cheevo.Title;
                item.Link = new Uri(Link);
                item.Description = cheevo.Points.ToString();
                item.PublicationDate = cheevo.Awarded;

                feed.Channel.AddItem(item);
            }

            feed.Save(output);
        }