private void DisplayValidationResults(DatasetsValidator validator) { if (validator.UniqueAbCount != _votingResults.Votes.Count) { MessageBox.Show("Duplicate (a,b) pairs detected"); return; } if (validator.InvalidVotes.Count > 0) { MessageBox.Show(string.Join(',', validator.InvalidVotes), "Invalid votes detected"); return; } MessageBox.Show(string.Format("Validation passed. Time - {0} (MT={1})", validator.ElapsedTime, validator.Multithreaded)); }
private async void ValidateParallelButtonClick(object sender, RoutedEventArgs args) { busy.IsBusy = true; try { (var encryptedVotes, var elGamal) = GetDataForValidation(); DatasetsValidator validator = new DatasetsValidator(_votingResults, encryptedVotes, elGamal); await validator.ValidateParallelAsync(); DisplayValidationResults(validator); } catch (Exception e) { MessageBox.Show(e.Message); } busy.IsBusy = false; }