private void findAJobButton_Click(object sender, EventArgs e) { FacebookObjectCollection <AppUser> hitechWorkerContacts; listBoxJobs.Items.Clear(); try { hitechWorkerContacts = r_AppEngine.FindHitechWorkersContacts(); if (hitechWorkerContacts != null && hitechWorkerContacts.Count > 0) { FacebookView.CreateThread(() => { addAllContactsToListBox(hitechWorkerContacts); }); FriendsDisplayer displayer = new FriendsDisplayer(hitechWorkerContacts, flowLayoutPanelContactPhotos); displayer.FriendOnClickDelegate += contactPic_Click; FacebookView.CreateThread(displayer.Display); } else { MessageBox.Show("Couldnt fetch work experience."); } } catch (Exception ex) { MessageBox.Show(ex.Message); } listBoxJobs.SelectedIndexChanged += new EventHandler(contactInfo_Click); }
private void findMeAMatchButton_Click(object sender, EventArgs e) { if (checkedGenderPreference()) { FacebookObjectCollection <AppUser> potentialMatches; setLabelsVisibility(false); try { potentialMatches = r_AppEngine.FindAMatch( checkBoxGirls.Checked, checkBoxBoys.Checked, comboBoxAgeRanges.Items[comboBoxAgeRanges.SelectedIndex].ToString()); if (potentialMatches != null && potentialMatches.Count > 0) { FriendsDisplayer displayer = new FriendsDisplayer(potentialMatches, flowLayoutPanelMatchPictures); displayer.FriendOnClickDelegate += match_Click; FacebookView.CreateThread(displayer.Display); } else { MessageBox.Show("No love for you today :("); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("Please choose preferred gender."); } }
private void fetchFriends() { try { friendsRoundedButton.Invoke(new Action(() => friendsRoundedButton.Enabled = false)); FriendsDisplayer displayer = new FriendsDisplayer(r_AppEngine.Friends, flowLayoutPanelFriends); displayer.Display(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }