public static void ShowCreateAndDelete() { OAuthTokens tokens = Configuration.GetTokens(); // See if the friendship exists (it should not) TwitterRelationship friendship = TwitterFriendship.Show(tokens, "rickydev").ResponseObject; // If it exists, delete it. if (friendship.Target.Following) { DeleteFriendship(tokens, friendship); } // Create the friendship TwitterUser followedUser = TwitterFriendship.Create(tokens, "rickydev").ResponseObject; Assert.IsNotNull(followedUser); // Get the friendship details (maybe again) friendship = TwitterFriendship.Show(tokens, "rickydev").ResponseObject; Assert.IsNotNull(friendship); Assert.IsNotNull(friendship.Target); // Delete the friendship (maybe again) DeleteFriendship(tokens, friendship); }
private void button1_Click(object sender, EventArgs e) { try { showUserResponse = TwitterUser.Show(oa, scr); user = showUserResponse.ResponseObject; if (user.IsFollowing == true) { TwitterResponse <TwitterUser> follow = TwitterFriendship.Delete(oa, user.ScreenName); update(); } else if (user.IsFollowing == false) { TwitterResponse <TwitterUser> follow = TwitterFriendship.Create(oa, user.ScreenName); update(); } } catch { MessageBox.Show("Some error happened"); } }