private void toggleLikeUnlike() { try { disposeOfImageIfNeeded(LikePictureBox); if (!m_IsImageLiked) { LikePictureBox.LoadAsync(k_UnlikeUrl); m_LikeHandler.Like(m_Photo); } else { LikePictureBox.LoadAsync(k_LikeUrl); m_LikeHandler.Unlike(m_Photo); } } catch { } finally { LikePictureBox.Refresh(); } }
private void imageForm_Load(object i_Sender, EventArgs i_EventArgs) { if (isPhotoLikedByUser()) { LikePictureBox.LoadAsync(k_UnlikeUrl); m_IsImageLiked = true; } else { LikePictureBox.LoadAsync(k_LikeUrl); m_IsImageLiked = false; } LikePictureBox.Refresh(); }