示例#1
0
        public void Initialize()
        {
            quest = new Quest();

            voteCounter.Reset();
            voteCounter.ClearPosts();
        }
示例#2
0
        /// <summary>
        /// Construct the tally results based on the stored list of posts.
        /// Run async so that it doesn't cause UI jank.
        /// </summary>
        /// <param name="token">Cancellation token.</param>
        public async Task TallyPosts(CancellationToken token)
        {
            if (voteCounter.Quest is null)
            {
                return;
            }

            try
            {
                voteCounter.VoteCounterIsTallying = true;
                voteCounter.TallyWasCanceled      = false;

                voteCounter.Reset();

                if (voteCounter.Posts.Count == 0)
                {
                    return;
                }

                await PreprocessPosts(token).ConfigureAwait(false);
                await ProcessPosts(token).ConfigureAwait(false);
            }
            catch (OperationCanceledException)
            {
                voteCounter.TallyWasCanceled = true;
            }
            finally
            {
                voteCounter.VoteCounterIsTallying = false;
            }
        }
示例#3
0
 public void Initialize()
 {
     voteCounter.Reset();
     voteCounter.PostsList.Clear();
 }
示例#4
0
 public void Initialize()
 {
     voteCounter.Reset();
     voteCounter.ClearPosts();
 }