예제 #1
0
        public async Task PostComment()
        {
            if (await _wordPressService.IsUserAuthenticated())
            {
                var comment = await _wordPressService.PostComment(Item.Id, CommentInput);

                if (comment != null)
                {
                    _inAppNotificationService.ShowInAppNotification("successfully posted comment");
                    CommentInput = String.Empty;
                }
                else
                {
                    _inAppNotificationService.ShowInAppNotification("something went wrong...");
                }
            }
            else
            {
                _inAppNotificationService.ShowInAppNotification("You have to log in first.");
            }
        }
예제 #2
0
        public async Task PostComment()
        {
            var res = ResourceLoader.GetForCurrentView();

            try
            {
                IsCommenting = true;

                if (await _wordPressService.IsUserAuthenticated())
                {
                    int replyto = 0;
                    if (CommentReply != null)
                    {
                        replyto = CommentReply.Id;
                    }
                    var comment = await _wordPressService.PostComment(SelectedPost.Id, CommentInput, replyto);

                    if (comment != null)
                    {
                        MessengerInstance.Send(new NotificationMessage(res.GetString("Notification_CommentPosted")));
                        CommentInput = String.Empty;
                        await GetComments(SelectedPost.Id);

                        CommentReplyUnset();
                    }
                    else
                    {
                        MessengerInstance.Send(new NotificationMessage(res.GetString("Notification_GenericError")));
                    }
                }
                else
                {
                    MessengerInstance.Send(new NotificationMessage(res.GetString("Notification_Unauthenticated")));
                }
            }
            finally
            {
                IsCommenting = false;
            }
        }