Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2544


Ignore:
Timestamp:
12/04/09 15:38:41 (15 years ago)
Author:
mkommend
Message:

added CloseView methods with CloseReason (ticket #771)

File:
1 edited

Legend:

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

    r2543 r2544  
    176176      if (InvokeRequired) Invoke((Action<IView>)CloseView, view);
    177177      else {
     178        if (views.ContainsKey(view))
     179          views[view].Close();
     180      }
     181    }
     182
     183    public void CloseView(IView view, CloseReason closeReason) {
     184      if (InvokeRequired) Invoke((Action<IView>)CloseView, view);
     185      else {
    178186        if (views.ContainsKey(view)) {
    179           ((ViewBase)view).closeReason = CloseReason.FormOwnerClosing;
     187          ((ViewBase)view).closeReason = closeReason;
    180188          views[view].Close();
    181189        }
     
    186194      foreach (IView view in views.Keys.ToArray())
    187195        CloseView(view);
     196    }
     197
     198    public virtual void CloseAllViews(CloseReason closeReason) {
     199      foreach (IView view in views.Keys.ToArray())
     200        CloseView(view,closeReason);
    188201    }
    189202    #endregion
Note: See TracChangeset for help on using the changeset viewer.