private void btn_comment_Click(object sender, EventArgs e)
 {
     if (txt_comment.Text.Length > 20)
     {
         MessageBox.Show("Comment Length most betwen 0-20 character.");
         return;
     }
     Instagram.Comment(this.post_id, this.token, txt_comment.Text);
 }
        private void btn_like_Click(object sender, EventArgs e)
        {
            switch (btn_like.Text)
            {
            case "Like":
                Instagram.Like(post_id, token);
                btn_like.Text = "Remove Like";
                break;

            case "Remove Like":
                Instagram.RemoveLike(post_id, token);
                btn_like.Text = "Like";
                break;
            }
        }
        private void btn_follow_Click(object sender, EventArgs e)
        {
            switch (btn_follow.Text)
            {
            case "Follow":
                Instagram.Follow(id, token);
                if (rel.data.target_user_is_private)
                {
                    btn_follow.Text = "Cancel Request";
                }
                else
                {
                    btn_follow.Text = "Unfollow";
                }
                break;

            case "Unfollow":
                Instagram.Unfollow(id, token);
                btn_follow.Text = "Follow";
                break;
            }
            refresh = true;
        }
示例#4
0
        private void Profile_GetDetail(object sender, string id, string menu)
        {
            ProfileDetail pf = sender as ProfileDetail;
            ProfileDetail profile;

            menu = menu.Trim();
            switch (menu)
            {
            case "Unfollow":
                lpd_notfollowback.remove(lpd_notfollowback.getProfileDetailById(id));
                lpd_notfollowback.refresh();
                lpd_following.remove(lpd_following.getProfileDetailById(id));
                Instagram.Unfollow(id, this.token);
                lpd_following.refresh();
                if (lpd_follower.searchById(id))
                {
                    profile          = new ProfileDetail();
                    profile.Username = pf.Username;
                    profile.Fullname = pf.Fullname;
                    profile.Picture  = pf.Picture;
                    profile.Id       = pf.Id;
                    profile.Name     = "Profile";
                    this.lpd_notfollow.add(profile, new string[] { "Follow", "Add to Always Follow", "Add To Favorite" });
                    profile.GetDetail += Profile_GetDetail;
                    this.lpd_notfollow.refresh();
                }

                break;

            case "Follow":
                lpd_following.add(pf, new string[] { "Unfollow", "Add to Always Follow", "Add To Favorite" });
                Instagram.Follow(id, this.token);
                lpd_notfollow.remove(pf);
                lpd_following.refresh();
                lpd_notfollow.refresh();
                break;

            case "Add To Favorite":
                if (this.lpd_favorite.searchById(id))
                {
                    break;
                }
                profile          = new ProfileDetail();
                profile.Username = pf.Username;
                profile.Id       = pf.Id;
                profile.Picture  = pf.Picture;
                profile.Fullname = pf.Fullname;
                lpd_favorite.add(profile, new string[] { "Remove on Favorite" });
                profile.GetDetail += Profile_GetDetail;
                lpd_favorite.refresh();
                lpd_follower.refresh();
                break;

            case "Remove on Favorite":
                lpd_favorite.remove(pf);
                lpd_favorite.refresh();
                break;

            case "Add to Always Follow":
                if (this.lpd_alwaysfollow.searchById(id))
                {
                    break;
                }
                profile          = new ProfileDetail();
                profile.Username = pf.Username;
                profile.Id       = pf.Id;
                profile.Picture  = pf.Picture;
                profile.Fullname = pf.Fullname;
                lpd_alwaysfollow.add(profile, new string[] { "Remove on Always Follow" });
                profile.GetDetail += Profile_GetDetail;
                lpd_alwaysfollow.refresh();
                lpd_alwaysfollow.refresh();
                break;
            }
        }