예제 #1
0
        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;
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: buntom/Blackjack
 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);
     }
 }