public void Initialize() { quest = new Quest(); voteCounter.Reset(); voteCounter.ClearPosts(); }
/// <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; } }
public void Initialize() { voteCounter.Reset(); voteCounter.PostsList.Clear(); }
public void Initialize() { voteCounter.Reset(); voteCounter.ClearPosts(); }