Exemple #1
0
        private async void GetAnswerRelation()
        {
            if (null == _answerService)
            {
                return;
            }

            RelationLoading = true;

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

            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.Voting = result.Result.Voting;

            Relationship.IsNotHelp   = result.Result.IsNotHelp;
            Relationship.IsThanked   = result.Result.IsThanked;
            Relationship.IsFavorited = result.Result.IsFavorited;
        }
        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++;
            }
        }