Exemple #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);
            }
        }
Exemple #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();
 }
Exemple #3
0
 //Clears all Generated Numbers and Resets the Current Number
 private void ClearGeneratedPrimeNumbers()
 {
     PrimeNumberIndexTextbox.Clear();
     ClearNumbers();
     IndexForPrintingFoundPrimeNumbers = 1;
 }