Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/11/10 19:32:52 (14 years ago)
Author:
mkommend
Message:

implemented fix for ticket #966

File:
1 edited

Legend:

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

    r2963 r3301  
    3131using HeuristicLab.PluginInfrastructure;
    3232using System.Collections;
     33using WeifenLuo.WinFormsUI.Docking;
    3334
    3435namespace HeuristicLab.MainForm.WindowsForms {
     
    162163      this.ActiveView = GetView((Form)sender);
    163164    }
     165
     166    protected override void OnFormClosing(FormClosingEventArgs e) {
     167      foreach (KeyValuePair<IView,Form > pair in this.views) {
     168        DockForm dockForm = pair.Value as DockForm;
     169        View view = pair.Key as View;
     170        if (view != null && dockForm != null && dockForm.DockState != DockState.Document) {
     171          view.CloseReason = CloseReason.ApplicationExitCall;
     172          view.OnClosingHelper(dockForm, e);
     173        }
     174      }
     175      base.OnFormClosing(e);
     176    }
     177
     178    protected override void OnFormClosed(FormClosedEventArgs e) {
     179      foreach (KeyValuePair<IView, Form> pair in this.views.ToList()) {
     180        DockForm dockForm = pair.Value as DockForm;
     181        View view = pair.Key as View;
     182        if (view != null && dockForm != null && dockForm.DockState != DockState.Document) {
     183          view.CloseReason = CloseReason.ApplicationExitCall;
     184          view.OnClosedHelper(dockForm, e);
     185          dockForm.Close();
     186        }
     187      }
     188      base.OnFormClosed(e);
     189    }
    164190    #endregion
    165191
     
    188214          form.Activated += new EventHandler(FormActivated);
    189215          form.FormClosed += new FormClosedEventHandler(ChildFormClosed);
    190          
     216
    191217        }
    192218        this.Show(view, firstTimeShown);
Note: See TracChangeset for help on using the changeset viewer.