private void backgroundWorkerSimulation_DoWork(object sender, DoWorkEventArgs e) { try { var runner = new BlackjackSim.Runner(textBoxConfigPath.Text); runner.Run(ProgressBarSetValue); MessageBox.Show("Simulation finished!", "BlackjackSim: Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message, "BlackjackSim: Exception occured", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
static void Main(string[] args) { try { if (ArgumentsValid(args)) { var runner = new BlackjackSim.Runner(configurationPath: args[0]); runner.Run(); } else { IncorrectArgumentsInfo(args); } } catch (Exception exception) { var message = "An exception occured in BlackjackSimRunner."; TraceWrapper.LogException(exception, message); } }