コード例 #1
0
 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)));
         }
     }
 }
コード例 #2
0
        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();
            }));
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: ShiranShaut/MyFacebookApp
        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));
                    }
                }
            }
        }
コード例 #4
0
 private void initAlbumsListBox()
 {
     AlbumsListBox.Invoke(new Action(() => AlbumsListBox.DisplayMember = "Name"));
     Album[] albumList = m_facebookManager.GetAlbumsList();
     AlbumsListBox.Invoke(new Action(() => AlbumsListBox.DataSource = albumList));
 }