//Searches List of Generated Number for certain Prime Number Index private void cmd_SearchForPrimeNumber(object sender, RoutedEventArgs e) { int SearchNumberValue = Int32.Parse(SearchNumber.Text); SearchNumberValue -= (SearchNumberValue / 10000) + 1; if (SearchNumberValue > CurrentPrimeNumberIndex) { PrimeNumberIndexTextbox.ScrollToEnd(); } else { PrimeNumberIndexTextbox.ScrollToLine(SearchNumberValue); } }
private void UpdateFoundPrimeNumberList(Object Obj, EventArgs e) { this.Dispatcher.Invoke(() => { if (ConfirmedPrimeNumbers.Count > 0) { foreach (long CPN in GetConfirmedPrimeNumbers()) { ProgressPercentage += progressIncreaseRatio; PrimeNumberIndexTextbox.AppendText(IndexForPrintingFoundPrimeNumbers.ToString("0,0") + ". " + CPN.ToString("0,0") + "\n"); ProgressBar.Value = ProgressPercentage; IndexForPrintingFoundPrimeNumbers++; } } }); PrimeNumberIndexTextbox.ScrollToEnd(); }
//Clears all Generated Numbers and Resets the Current Number private void ClearGeneratedPrimeNumbers() { PrimeNumberIndexTextbox.Clear(); ClearNumbers(); IndexForPrintingFoundPrimeNumbers = 1; }