private void ButtonRun_Click(object sender, EventArgs e) { MainTask task = new MainTask() { NeuroDirectory = TextBoxNeuroDirectory.Text }; task.ImageLimit = (int)NumericUpDownImageLimit.Value; task.ParseMethod(ComboBoxMethod.Text); if (sender == ButtonRunTraining) { task.Type = MainTaskType.Training; task.Inputs = GetFiles(TextBoxInputDirectory.Text); } else if(sender == ButtonRunForecast) { task.Type = MainTaskType.Forecast; task.Inputs = GetFiles(TextBoxForecast.Text); task.Outputs.Add(TextBoxForecastOutput.Text); } Properties.Settings.Default.Save(); if (task.Type == MainTaskType.None) return; EnableButtons(false); BackgroundWorkerMain.RunWorkerAsync(task); }