private async void button5_Click(object sender, EventArgs e) { if (Tab3Checks()) { button5.Visible = false; var inputValues = textBox7.Text; var processedResult = ""; var splitedValues = textBox7.Text.Split(new string[] { ",", "-", ";" }, StringSplitOptions.RemoveEmptyEntries); textBox8.Text = DateTime.Now + ": Calculating in progress..\r\n"; backgroundWorker3.RunWorkerAsync(); var uniqElements = splitedValues.Distinct().ToArray(); var maxRank = uniqElements.Length; var maxElementInItem = 0; if (checkBox2.Checked) { maxRank = (int)numericUpDown1.Value; maxElementInItem = (int)numericUpDown2.Value; } await Task.Run(() => { try { processedResult = Task_3.GenerateGraySequenceEntryQueued(uniqElements, maxRank, maxElementInItem); } catch (Exception ex) { processedResult = "Error occured: " + ex.Message; } }); textBox8.Text += DateTime.Now + ":" + processedResult; button5.Visible = true; backgroundWorker3.CancelAsync(); } }
static void Main(string[] args) { Task_1 task_1 = new Task_1(); Task_2 task_2 = new Task_2(); Task_3 task_3 = new Task_3(); }
static void Main(string[] args) { Task_1.Execute(); Task_2.Execute(); Task_3.Execute(); }