예제 #1
0
        private void listBoxTaggetFriends_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.AlbumsTaggetUsers.SelectedItems.Count == 1)
            {
                string taggetFriendName = this.AlbumsTaggetUsers.SelectedItem.ToString();

                this.AlbumPictureBox.LoadAsync(this.m_Album.Photos[0].URL);

                AlbumsPhotosPanel.Controls.Clear();
                foreach (Photo albumPhoto in this.m_Album.Photos)
                {
                    if (albumPhoto.Tags != null && albumPhoto.Tags.Count > 0)
                    {
                        foreach (PhotoTag tagg in albumPhoto.Tags)
                        {
                            if (tagg.User.Name == taggetFriendName)
                            {
                                AlbumsPhotosControler thumbnail = new AlbumsPhotosControler(albumPhoto.URL, this.AlbumsPhotosPanel.Controls.Count);
                                thumbnail.PictureBox.Click += new EventHandler(this.thumbnail_Click);
                                this.AlbumsPhotosPanel.Controls.Add(thumbnail);
                                break;
                            }
                        }
                    }
                }
            }
        }
예제 #2
0
 /// <summary>
 /// Display selected album photos
 /// </summary>
 private void displaySelectedAlbumsPhotos()
 {
     if (this.User.AlbumsListBox.SelectedItems.Count == 1)
     {
         this.m_Album = this.User.AlbumsListBox.SelectedItem as Album;
         AlbumsPhotosPanel.Controls.Clear();
         if (this.m_Album.Photos.Count > 0)
         {
             this.AlbumPictureBox.LoadAsync(this.m_Album.Photos[0].URL);
             foreach (Photo albumPhoto in this.m_Album.Photos)
             {
                 AlbumsPhotosControler thumbnail = new AlbumsPhotosControler(albumPhoto.URL, AlbumsPhotosPanel.Controls.Count);
                 thumbnail.PictureBox.Click += new EventHandler(this.thumbnail_Click);
                 AlbumsPhotosPanel.Controls.Add(thumbnail);
             }
         }
     }
 }