Beispiel #1
0
        /// <summary>
        /// Display selected album tags
        /// </summary>
        private void displaySelectedAlbumsTags()
        {
            if (this.User.AlbumsListBox.SelectedItems.Count == 1)
            {
                this.m_Album = this.m_User.AlbumsListBox.SelectedItem as Album;
                this.AlbumsTaggetUsers.Items.Clear();
                IAggregate albumPhotosAggregate = new AlbumPhotosAggregate(this.m_Album);
                IIterator albumPhotosIterator = albumPhotosAggregate.CreateIterator();

                foreach (Photo photo in albumPhotosIterator.NextItem)
                {
                    if (photo != null && photo.Tags != null)
                    {
                        if (photo.Tags.Count > 0)
                        {
                            displaySelectedPhotoTags(photo);
                        }
                    }
                }
            }
        }
Beispiel #2
0
        private void listBoxTaggetFriends_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.AlbumsTaggetUsers.SelectedItems.Count == 1)
            {
                string taggetFriendName = this.AlbumsTaggetUsers.SelectedItem.ToString();
                AlbumsPhotosPanel.Controls.Clear();
                IAggregate albumPhotosAggregate = new AlbumPhotosAggregate(this.m_Album);
                IIterator albumPhotosIterator = albumPhotosAggregate.CreateIterator();

                if (!albumPhotosIterator.IsDone)
                {
                    this.AlbumPictureBox.LoadAsync((albumPhotosIterator.CurrentItem as Photo).URL);

                    foreach (Photo photo in albumPhotosIterator.NextItem)
                    {
                        if (photo.Tags != null && photo.Tags.Count > 0)
                        {
                            foreach (PhotoTag tagg in photo.Tags)
                            {
                                if (tagg.User.Name == taggetFriendName)
                                {
                                    AlbumsPhotosControler thumbnail = new AlbumsPhotosControler(photo.URL, this.AlbumsPhotosPanel.Controls.Count);
                                    thumbnail.PictureBox.Click += new EventHandler(this.thumbnail_Click);
                                    this.AlbumsPhotosPanel.Controls.Add(thumbnail);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #3
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();

                IAggregate albumPhotosAggregate = new AlbumPhotosAggregate(this.m_Album);
                IIterator albumPhotosIterator = albumPhotosAggregate.CreateIterator();

                Thread threadDisplaySelectedAlbumsPhotos = new Thread(new ThreadStart(
                    () => this.displaySelectedAlbumsPhotosThread(albumPhotosIterator)));
                threadDisplaySelectedAlbumsPhotos.Start();
            }
        }