private void uxFindPrimes_Click(object sender, EventArgs e) { int bound = 0; try { bound = Convert.ToInt32(uxNumberBound.Text); } catch (FormatException) { MessageBox.Show("Invalid bound"); return; } SieveList list = new SieveList(); list.BuildList(bound); list.FindPrimes(); StringBuilder s = new StringBuilder(); foreach (int i in list) { s.Append(i); s.Append(' '); } uxPrimes.Text = s.ToString(); }
private void uxFindPrimeButton_Click(object sender, EventArgs e) { uxOutput.Text = ""; int bound = Convert.ToInt32(uxInput.Text); SieveList list = new SieveList(); list.BuildList(bound); list.FindPrimes(); foreach (int num in list) { uxOutput.Text += num + " "; } }