/// <summary> /// Fired when a new message has been submitted. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ReplyBox_OnCommentSubmitted(object sender, OnCommentSubmittedArgs 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, OnCommentSubmittedArgs e) { OnOpenCommentBox openBoxContext = (OnOpenCommentBox)e.Context; if (openBoxContext != null) { // Replace the context e.Context = openBoxContext.Context; bool 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 parentOrOrgionalId, OnCommentSubmittedArgs args) { return(((CommentCollector)m_commentCollector.GetCollector()).CommentAddedOrEdited(parentOrOrgionalId, args.Response, args.IsEdit)); }
/// <summary> /// Called when is added or edited /// </summary> public bool CommentAddedOrEdited(string parentOrOrgionalId, OnCommentSubmittedArgs args) { DeferredCollector <Comment> collector = EnsureCollector(); return(((CommentCollector)collector.GetCollector()).CommentAddedOrEdited(parentOrOrgionalId, args.Response, args.IsEdit)); }