/// <summary> /// Fired when a new message has been submitted. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ReplyBox_OnCommentSubmitted(object sender, CommentSubmittedArgs e) { // Validate the response, this isn't 100% fool proof but it is close. if (e.Response.Contains("\"author\":")) { // We are good, hide the box ui_replyBox.HideBox(); } else { ui_replyBox.HideLoadingOverlay(); App.BaconMan.MessageMan.ShowMessageSimple("That's Not Good", "We can't send this message right now, reddit returned an unexpected result. Try again later."); } }
/// <summary> /// Fired when content has been submitted in the comment box. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CommentBox_OnCommentSubmitted(object sender, CommentSubmittedArgs e) { var openBoxContext = (OpenCommentBox)e.Context; if (openBoxContext != null) { // Replace the context e.Context = openBoxContext.Context; var wasActionSuccessful = openBoxContext.CommentBoxSubmitted(sender, e); // Hide the box if good if (wasActionSuccessful) { ui_commentBox.HideBox(true); } else { ui_commentBox.HideLoadingOverlay(); } } }
/// <summary> /// Called when is added or edited /// </summary> public bool CommentAddedOrEdited(string parentOrOriginalId, CommentSubmittedArgs args) { var collector = EnsureCollector(); return(((CommentCollector)collector.GetCollector()).CommentAddedOrEdited(parentOrOriginalId, args.Response, args.IsEdit)); }