Changeset 3548


Ignore:
Timestamp:
04/27/10 21:33:16 (12 years ago)
Author:
gkronber
Message:

Fixed cross-thread exception potential in AlgorithmView. #990

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs

    r3526 r3548  
    195195            IProblem problem = content as IProblem;
    196196            if (problem == null)
    197               MessageBox.Show(this, "The selected file does not contain a problem.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);
     197              Invoke(new Action(() =>
     198                MessageBox.Show(this, "The selected file does not contain a problem.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error)));
    198199            else if (!Content.ProblemType.IsInstanceOfType(problem))
    199               MessageBox.Show(this, "The selected file contains a problem type which is not supported by this algorithm.", "Invalid Problem Type", MessageBoxButtons.OK, MessageBoxIcon.Error);
     200              Invoke(new Action(() =>
     201                MessageBox.Show(this, "The selected file contains a problem type which is not supported by this algorithm.", "Invalid Problem Type", MessageBoxButtons.OK, MessageBoxIcon.Error)));
    200202            else
    201203              Content.Problem = problem;
    202204          }
    203205          catch (Exception ex) {
    204             Auxiliary.ShowErrorMessageBox(ex);
     206            Invoke(new Action(() => Auxiliary.ShowErrorMessageBox(ex)));
    205207          }
    206208          finally {
Note: See TracChangeset for help on using the changeset viewer.