private void ReplyToComment() { if (string.IsNullOrEmpty(replyEditTextBox.Text)) { MessageBox.Show(_localizedStrings.Messages.MissingReply); replyEditTextBox.Focus(); return; } if (!App.isNetworkAvailable()) { Exception connErr = new NoConnectionException(); this.HandleException(connErr); return; } Comment comment = DataContext as Comment; Comment reply = new Comment() { Author = this._currentBlog.Username, Parent = comment.CommentId, Content = replyEditTextBox.Text }; NewCommentRPC rpc = new NewCommentRPC(this._currentBlog, comment, reply); rpc.Completed += new XMLRPCCompletedEventHandler <Comment>(OnNewCommentRPCCompleted); rpc.ExecuteAsync(); _currentConnection = rpc; ApplicationBar.IsVisible = false; App.WaitIndicationService.ShowIndicator(_localizedStrings.Messages.ReplyingToComment); }
private void OnNewCommentRPCCompleted(object sender, XMLRPCCompletedEventArgs <Comment> args) { NewCommentRPC rpc = sender as NewCommentRPC; rpc.Completed -= OnNewCommentRPCCompleted; if (args.Cancelled) { return; } else if (null == args.Error) { NavigationService.GoBack(); } else { this.HandleException(args.Error); } }
private void OnNewCommentRPCCompleted(object sender, XMLRPCCompletedEventArgs <Comment> args) { NewCommentRPC rpc = sender as NewCommentRPC; rpc.Completed -= OnNewCommentRPCCompleted; if (args.Cancelled) { return; } else if (null == args.Error) { //fire off a request for the latest comment so we can get our comment updated //with the latest from the server. DataService.Current.FetchCurrentBlogCommentsAsync(false); NavigationService.GoBack(); } else { this.HandleException(args.Error); } }
private void ReplyToComment() { if (string.IsNullOrEmpty(replyEditTextBox.Text)) { if (_messageBoxIsShown) return; _messageBoxIsShown = true; MessageBox.Show(_localizedStrings.Messages.MissingReply); _messageBoxIsShown = false; replyEditTextBox.Focus(); return; } if (!App.isNetworkAvailable()) { Exception connErr = new NoConnectionException(); this.HandleException(connErr); return; } Blog currentBlog = App.MasterViewModel.CurrentBlog; Comment comment = DataContext as Comment; Comment reply = new Comment() { Author = currentBlog.Username, Parent = comment.CommentId, Content = replyEditTextBox.Text }; NewCommentRPC rpc = new NewCommentRPC(currentBlog, comment, reply); rpc.Completed += new XMLRPCCompletedEventHandler<Comment>(OnNewCommentRPCCompleted); rpc.ExecuteAsync(); _currentConnection = rpc; ApplicationBar.IsVisible = false; App.WaitIndicationService.ShowIndicator(_localizedStrings.Messages.ReplyingToComment); }