Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/25/09 16:34:27 (16 years ago)
Author:
gkronber
Message:
  • added a check for InvokeRequired in AdvancedOptimizationFrontend
  • open a new view for snapshots and finished engines from the hive engine.

#545 (Engine which can be executed in the Hive)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.AdvancedOptimizationFrontend/3.2/MainForm.cs

    r1529 r2105  
    100100    /// is neither a view nor an editor.</exception>
    101101    /// <param name="control">The control to display.</param>
     102    delegate void ShowControlDelegate(IControl control);
    102103    public void ShowControl(IControl control) {
    103       DockContent content;
    104       if (control is IEditor)
    105         content = new EditorForm((IEditor)control);
    106       else if (control is IView)
    107         content = new ViewForm((IView)control);
    108       else
    109         throw new InvalidOperationException("Control is neither a view nor an editor.");
    110 
    111       content.TabText = content.Text;
    112       content.Show(dockPanel);
     104      if (InvokeRequired) Invoke((Action<IControl>)ShowControl,control);
     105      else {
     106        DockContent content;
     107        if (control is IEditor)
     108          content = new EditorForm((IEditor)control);
     109        else if (control is IView)
     110          content = new ViewForm((IView)control);
     111        else
     112          throw new InvalidOperationException("Control is neither a view nor an editor.");
     113
     114        content.TabText = content.Text;
     115        content.Show(dockPanel);
     116      }
    113117    }
    114118    #endregion
Note: See TracChangeset for help on using the changeset viewer.