コード例 #1
0
ファイル: VoteCounterTests.cs プロジェクト: MizMahem/NetTally
        public void Initialize()
        {
            quest = new Quest();

            voteCounter.Reset();
            voteCounter.ClearPosts();
        }
コード例 #2
0
ファイル: Tally.cs プロジェクト: MizMahem/NetTally
        /// <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
ファイル: VoteStorageTests.cs プロジェクト: MizMahem/NetTally
 public void Initialize()
 {
     voteCounter.Reset();
     voteCounter.ClearPosts();
 }