Exemplo n.º 1
0
        private async Task GenerateAsyncInternal(IDictionaryRequest request, CancellationToken cancellationToken)
        {
            progressPercentage = 0;
            try
            {
                await LazyInitialization();

                var partitionInfo = PartitionInfo.Get(request.Iterations, threadService.GetThreadCountByIterations(request.Iterations));

                FireGenerateChanged(new ProgressChangedEventArgs(progressPercentage += 5, $"Created {partitionInfo.NumberOfPartitions} partitions."));

                GenerateWords(request, partitionInfo);
            }
            catch (Exception e)
            {
                FireGenerateCompleted(new DictionaryEventArgs(e, false, this, null));
            }
        }