Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2358 for trunk/sources


Ignore:
Timestamp:
09/15/09 16:00:27 (15 years ago)
Author:
mkommend
Message:

set ActiveView to null during ViewClosed, if the active view is being closed (ticket #743)

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

Legend:

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

    r2309 r2358  
    7373    private void DockFormClosed(object sender, FormClosedEventArgs e) {
    7474      DockForm dockForm = (DockForm)sender;
    75       views.Remove(dockForm.View);
    76       if (views.Count == 0)
    77         ActiveView = null;
    78 
    7975      ViewClosed(dockForm.View);
    8076      dockForm.Activated -= new EventHandler(DockFormActivated);
  • trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs

    r2350 r2358  
    9898      get { return this.userInterfaceItemType; }
    9999      protected set { this.userInterfaceItemType = value; }
     100    }
     101
     102    protected List<IView> views;
     103    public IEnumerable<IView> Views {
     104      get { return views; }
    100105    }
    101106
     
    140145    }
    141146
    142     protected List<IView> views;
    143     public IEnumerable<IView> Views {
    144       get { return views; }
    145     }
     147 
    146148
    147149    public virtual void ShowView(IView view) {
     
    162164
    163165    protected virtual void ViewClosed(IView view) {
     166      views.Remove(view);
     167      if (ActiveView == view)
     168        ActiveView = null;
    164169    }
    165170    #endregion
  • trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs

    r2309 r2358  
    8484    private void MultipleDocumentFormClosed(object sender, FormClosedEventArgs e) {
    8585      DocumentForm form = (DocumentForm)sender;
    86       views.Remove(form.View);
    87       if (views.Count == 0)
    88         ActiveView = null;
    89 
    9086      ViewClosed(form.View);
    9187      form.Activated -= new EventHandler(MultipleDocumentFormActivated);
  • trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.cs

    r2309 r2358  
    7474    private void DockFormClosed(object sender, FormClosedEventArgs e) {
    7575      DocumentForm form = (DocumentForm)sender;
    76       views.Remove(form.View);
    77       if (views.Count == 0)
    78         ActiveView = null;
    79 
    8076      ViewClosed(form.View);
    8177      form.Activated -= new EventHandler(DockFormActivated);
Note: See TracChangeset for help on using the changeset viewer.