/// <summary> /// This method removes a comment from a post. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret)); /// api.Session.UserId = Constants.UserId; /// api.Stream.RemoveCommentAsync(Constants.UserId, Constants.CommentId, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="uid">The user ID of the user who made the comment. If this parameter is not specified, then it defaults to the session user. Note: This parameter applies only to Web applications. Facebook ignores this parameter if it is passed by a desktop application.</param> /// <param name="commentId">The ID for the comment you want to remove.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>This call returns true if the comment was removed, or false and an error code if the comment was not removed.</returns> public void RemoveCommentAsync(long uid, string commentId, RemoveCommentCallback callback, Object state) { RemoveComment(uid, commentId, true, callback, state); }
private bool RemoveComment(long uid, string comment_id, bool isAsync, RemoveCommentCallback callback, Object state) { var parameterList = new Dictionary<string, string> { { "method", "facebook.stream.removeComment" } }; Utilities.AddOptionalParameter(parameterList, "uid", uid); Utilities.AddRequiredParameter(parameterList, "comment_id", comment_id); if (isAsync) { SendRequestAsync<stream_removeComment_response, bool>(parameterList, uid <= 0, new FacebookCallCompleted<bool>(callback), state); return true; } var response = SendRequest<stream_removeComment_response>(parameterList, uid <= 0); return response == null ? true : response.TypedValue; }
/// <summary> /// This method removes a comment from a post. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new FBMLCanvasSession(Constants.WebApplicationKey, Constants.WebSecret)); /// api.Session.UserId = Constants.UserId; /// api.Stream.RemoveCommentAsync(Constants.CommentId, AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="commentId">The ID for the comment you want to remove.</param> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>This call returns true if the comment was removed, or false and an error code if the comment was not removed.</returns> public void RemoveCommentAsync(string commentId, RemoveCommentCallback callback, Object state) { RemoveCommentAsync(0, commentId, callback, state); }