Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/25/09 13:25:40 (15 years ago)
Author:
mkommend
Message:

added invoke required checks in close view methods (ticket #716)

Location:
trunk/sources/HeuristicLab.MainForm/3.2
Files:
4 edited

Legend:

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

    r2308 r2309  
    6363
    6464    public override void CloseView(IView view) {
    65       DockForm dockform = FindForm(view);
    66       if (dockform != null)
    67         dockform.Close();
     65      if (InvokeRequired) Invoke((Action<IView>)CloseView, view);
     66      else {
     67        DockForm dockform = FindForm(view);
     68        if (dockform != null)
     69          dockform.Close();
     70      }
    6871    }
    6972
  • trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs

    r2306 r2309  
    8282      protected set {
    8383        if (this.activeView != value) {
    84           this.activeView = value;
    85           OnActiveViewChanged();
     84          if (InvokeRequired) {
     85            Action<IView> action = delegate(IView activeView) { this.ActiveView = activeView; };
     86            Invoke(action, new object[] { value });
     87          } else {
     88            this.activeView = value;
     89            OnActiveViewChanged();
     90          }
    8691        }
    8792      }
  • trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs

    r2308 r2309  
    7070
    7171    public override void CloseView(IView view) {
    72       DocumentForm documentForm = FindForm(view);
    73       if (documentForm != null)
    74         documentForm.Close();
     72      if (InvokeRequired) Invoke((Action<IView>)CloseView, view);
     73      else {
     74        DocumentForm documentForm = FindForm(view);
     75        if (documentForm != null)
     76          documentForm.Close();
     77      }
    7578    }
    7679
  • trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.cs

    r2308 r2309  
    6464
    6565    public override void CloseView(IView view) {
    66       DocumentForm documentForm = FindForm(view);
    67       if (documentForm != null)
    68         documentForm.Close();
     66      if (InvokeRequired) Invoke((Action<IView>)CloseView, view);
     67      else {
     68        DocumentForm documentForm = FindForm(view);
     69        if (documentForm != null)
     70          documentForm.Close();
     71      }
    6972    }
    7073
Note: See TracChangeset for help on using the changeset viewer.