public void FetchUserAlbums(Album[] i_UserAlbums) { if (User.Albums.Count > 0) { AlbumsListBox.Invoke(new Action(() => AlbumsListBox.Items.Clear())); foreach (Album album in i_UserAlbums) { AlbumsListBox.Invoke(new Action(() => AlbumsListBox.DisplayMember = "Name")); AlbumsListBox.Invoke(new Action(() => AlbumsListBox.Items.Add(album))); } } }
public void ClearhAllInfo() { BirthdaysTable.Clear(); r_BirthdayDataKeeper.Birthdays.Clear(); VideoPostListBox.Invoke(new Action(() => VideoPostListBox.Items.Clear())); FriendsListBox.Invoke(new Action(() => { FriendsListBox.Items.Clear(); FriendProfilePicture.ImageLocation = null; })); AlbumsListBox.Invoke(new Action(() => { AlbumsListBox.Items.Clear(); FacebookAlbum.PhotosDataGridView.Columns.Clear(); })); }
private void fetchAlbums() { if (checkIfUserLoggedIn()) { List <Album> albums = getAlbumsList(); if (albums.Count == 0) { MessageBox.Show("No albums to show"); } else { if (!AlbumsListBox.InvokeRequired) { AlbumBindingSource.DataSource = albums; } else { AlbumsListBox.Invoke(new Action(() => AlbumBindingSource.DataSource = albums)); } } } }
private void initAlbumsListBox() { AlbumsListBox.Invoke(new Action(() => AlbumsListBox.DisplayMember = "Name")); Album[] albumList = m_facebookManager.GetAlbumsList(); AlbumsListBox.Invoke(new Action(() => AlbumsListBox.DataSource = albumList)); }