Beispiel #1
0
        //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);
            }
        }
Beispiel #2
0
 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();
 }