Example #1
0
        public AlbumsData GetLastAlbums(int i_Number)
        {
            List <Album> firstAlbums = null;
            AlbumsData   retVal      = new AlbumsData();

            try
            {
                var albumsOrdered = m_LoggedInUser.Albums.Where(ua => ua.Photos.Count > 0).OrderByDescending(ua => ua.CreatedTime).ToList();
                firstAlbums = albumsOrdered.Take(i_Number).ToList();
            }
            catch
            {
                throw new Exception("Oops, looks like we cannot retrive you'r album data");
            }

            if (firstAlbums != null && firstAlbums.Count > 0)
            {
                foreach (var albom in firstAlbums)
                {
                    // TODO:
                    var    picThumb = albom.Photos.FirstOrDefault();
                    string picUrl   = string.Empty;
                    if (picThumb != null)
                    {
                        picUrl = picThumb.ThumbURL;
                    }

                    retVal.AddNewAlbum(new SingleAlbumData
                    {
                        AlbomName   = albom.Name,
                        FirstPicUrl = picUrl
                    });
                }
            }

            return(retVal);
        }
Example #2
0
 public AlbumDataIterator(AlbumsData i_Collection)
 {
     m_Collection = i_Collection;
 }