private void updateLikeButtonName() { try { if (FacebookLogic.IsSelectedItemLikedByUser(m_SelectedItem)) { likeButton.Text = "Dislike"; } else { likeButton.Text = "Like"; } } catch (Exception e) { MessageBox.Show("There was a problem determining user post like."); } }
private void likeButton_Click(object sender, EventArgs e) { try { if (m_SelectedItem != null) { if (FacebookLogic.IsSelectedItemLikedByUser(m_SelectedItem)) { m_SelectedItem.DislikePost(); } else { m_SelectedItem.LikePost(); } } } catch (Exception ex) { MessageBox.Show("There was a problem liking the post."); } }