Exemplo n.º 1
0
        private static void InitializeAlbums()
        {
            m_albums = new Albums();

            AlbumQuery albumQuery = new AlbumQuery();
            albumQuery.Uri = new Uri(PicasaQuery.CreatePicasaUri(ConfigurationManager.AppSettings.Get("PicasaWebUserId")));
            albumQuery.Access = PicasaQuery.AccessLevel.AccessPublic;

            PicasaFeed feed = PicasaService.Query(albumQuery);

            if (feed != null && feed.Entries.Count > 0)
            {
                foreach (PicasaEntry entry in feed.Entries)
                {
                    Album album = new Album();
                    album.Title = entry.Title.Text;
                    album.Summary = entry.Summary.Text.Replace("\r\n", "<br/>");
                    album.FeedUri = entry.FeedUri;
                    album.ThumbnailUrl = entry.Media.Thumbnails[0].Attributes["url"].ToString();
                    album.NumberOfPhotos = ((GPhotoNumPhotos)entry.ExtensionElements[5]).IntegerValue;

                    m_albums.Add(album);
                }
            }
        }
Exemplo n.º 2
0
 public static bool TryGetAlbum(string id, out Album album)
 {
     if (m_albums == null)
         InitializeAlbums();
     return m_albums.TryGetItem(id, out album);
 }