private async Task OfflineAnswer(Int32 answerid)
        {
            if (null == _answer)
            {
                return;
            }

            var detailTask   = _answer.GetAnswerDetailAsync(LoginUser.Current.Token, answerid, true);
            var relationTask = _answer.GetAnswerRelationshipAsync(LoginUser.Current.Token, answerid, true);
            var favoriteTask = _answer.CheckFavoriteAsync(LoginUser.Current.Token, answerid, true);

            var commentsTask = OfflineAnswerComments(answerid);

            await detailTask;
            await relationTask;
            await favoriteTask;
            await commentsTask;

            lock (_answersSync)
            {
                AnswersCount++;
            }
        }
Ejemplo n.º 2
0
        private async void CheckFavoriteMethod()
        {
            if (null == _answerService)
            {
                return;
            }

            RelationLoading = true;

            var result =
                await _answerService.CheckFavoriteAsync(LoginUser.Current.Token, AnswerId);

            RelationLoading = false;

            if (null != result.Error)
            {
                ToasteIndicator.Instance.Show(String.Empty, result.Error.Message, null, 3);

                Debug.WriteLine(Regex.Unescape(result.Error.Message));
                return;
            }

            Relationship.IsFavorited = result.Result.IsFavorited;
        }